Skip to content

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

Closed

Description

@wan-kong

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?

Activity

  1. rekram1-node commented on Sep 24, 2025

    @rekram1-node
    Contributor

    hmm we will fix this

  2. rekram1-node commented on Dec 28, 2025

    @rekram1-node
    Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions