You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Vite seems to have troubles to correctly resolve node modules that have exports defined in their package.json. This issue includes a repro for @urql/preact but I found the same issues with @urql/core and wonka. Dropping the exports from the package.jsons helped in all cases.
EDIT: Only applicable to node 13, works with node 12
vite:resolve (redirect) @urql/preact -> dist/urql-preact.mjs +4ms
[vite] Error while resolving node_modules with id "@urql/preact/dist/urql-preact.mjs":
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './dist/urql-preact.mjs' is not defined by "exports" in xxx/vite-mjs-repro/node_modules/@urql/preact/package.json
at applyExports (internal/modules/cjs/loader.js:524:9)
at resolveExports (internal/modules/cjs/loader.js:541:12)
at Function.Module._findPath (internal/modules/cjs/loader.js:661:22)
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:963:27)
at resolveFileName (xxx/vite-mjs-repro/node_modules/vite/node_modules/resolve-from/index.js:29:39)
at resolveFrom (xxx/vite-mjs-repro/node_modules/vite/node_modules/resolve-from/index.js:43:9)
at Object.module.exports [as default] (xxx/vite-mjs-repro/node_modules/vite/node_modules/resolve-from/index.js:46:47)
at xxx/vite-mjs-repro/node_modules/vite/dist/server/serverPluginModuleResolve.js:79:48
at async xxx/vite-mjs-repro/node_modules/vite/dist/server/serverPluginModuleRewrite.js:41:9 {
code: 'ERR_PACKAGE_PATH_NOT_EXPORTED'
The text was updated successfully, but these errors were encountered:
Describe the bug
Vite seems to have troubles to correctly resolve node modules that have
exports
defined in theirpackage.json
. This issue includes a repro for@urql/preact
but I found the same issues with@urql/core
andwonka
. Dropping theexports
from thepackage.json
s helped in all cases.EDIT: Only applicable to node 13, works with node 12
Reproduction
Add the following import to a basic vite setup:
(See https://github.com/sventschui/vite-mjs-repro/tree/urql)
System Info
vite
version: 0.14.2Logs (Optional if provided reproduction)
The text was updated successfully, but these errors were encountered: