Package · Imports
PKG0009Put the default export condition last
Find conditions objects in package.json "exports" where a "default" that always resolves comes before other conditions, so Node, Vite and other resolvers never reach them.
vite-doctor/packageimportswarnSuggestion
Why it happens
Resolvers walk an exports conditions object in key order and take the first key that matches. "default" matches every environment, so once it resolves to a path, an "import", "require", "node" or "browser" key after it is never read. The package then loads the "default" file everywhere, which usually means the CommonJS build for ESM consumers or the Node build in the browser.
Fix
Move "default" to the end of its conditions object, after every condition that should win over it.
Example
Let import and require win over default
Before
{ "exports": { ".": { "default": "./dist/index.cjs", "import": "./dist/index.mjs" } } }
After
{ "exports": { ".": { "import": "./dist/index.mjs", "default": "./dist/index.cjs" } } }
Verify the fix
Run only this rule after editing so the report stays focused on the diagnostic you are closing:
pnpm vite-doctor . --extends package/recommended --rules package/no-condition-after-default