[JS SDK] export field in package.json breaks Vite resolution #1807

Closed
opened 2026-02-16 17:32:42 -05:00 by yindo · 2 comments
Owner

Originally created by @wan-kong on GitHub (Sep 24, 2025).

Originally assigned to: @thdxr on GitHub.

When using the JS SDK with Vite, I encountered the following error:

✘ [ERROR] Failed to resolve entry for package "@opencode-ai/sdk".
The package may have incorrect main/module/exports specified in its package.json. [plugin vite:dep-scan]

After checking the package.json, I noticed it includes a custom export field named development:

"exports": {
   ".": {
      "development": "./src/index.ts",
      "import": "./dist/index.js",
      "types": "./dist/index.d.ts"
    },
}

However, according to the package.json schema, there is no standard development condition.
This seems to cause Vite’s dependency resolver to fail.

Questions
• Why is the development field present here?
• Is it an intentional extension, or a mistake?
• Should this be replaced with something like "default" or another officially supported condition?

Originally created by @wan-kong on GitHub (Sep 24, 2025). Originally assigned to: @thdxr on GitHub. When using the JS SDK with Vite, I encountered the following error: ✘ [ERROR] Failed to resolve entry for package "@opencode-ai/sdk". The package may have incorrect main/module/exports specified in its package.json. [plugin vite:dep-scan] After checking the package.json, I noticed it includes a custom export field named development: ``` "exports": { ".": { "development": "./src/index.ts", "import": "./dist/index.js", "types": "./dist/index.d.ts" }, } ``` However, according to the [package.json schema](https://json.schemastore.org/package.json), there is no standard development condition. This seems to cause Vite’s dependency resolver to fail. Questions • Why is the development field present here? • Is it an intentional extension, or a mistake? • Should this be replaced with something like "default" or another officially supported condition?
yindo closed this issue 2026-02-16 17:32:42 -05:00
Author
Owner

@rekram1-node commented on GitHub (Sep 24, 2025):

hmm we will fix this

@rekram1-node commented on GitHub (Sep 24, 2025): hmm we will fix this
Author
Owner

@rekram1-node commented on GitHub (Dec 27, 2025):

[automated] Closing due to 90+ days of inactivity. Feel free to reopen if you still need this!

@rekram1-node commented on GitHub (Dec 27, 2025): [automated] Closing due to 90+ days of inactivity. Feel free to reopen if you still need this!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#1807