Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'ERR_PACKAGE_PATH_NOT_EXPORTED' #14

Closed
jamesb93 opened this issue Jan 30, 2021 · 11 comments
Closed

'ERR_PACKAGE_PATH_NOT_EXPORTED' #14

jamesb93 opened this issue Jan 30, 2021 · 11 comments

Comments

@jamesb93
Copy link

I have a long working project with mdsvex and sapper. After running yarn run dev today I get this error:

node:internal/process/promises:227
          triggerUncaughtException(err, true /* fromPromise */);
          ^

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './compiler.js' is not defined by "exports" in /Users/james/dev/webdev/phd-sapper/node_modules/svelte/package.json
    at new NodeError (node:internal/errors:329:5)
    at throwExportsNotFound (node:internal/modules/esm/resolve:315:9)
    at packageExportsResolve (node:internal/modules/esm/resolve:540:3)
    at resolveExports (node:internal/modules/cjs/loader:473:36)
    at Function.Module._findPath (node:internal/modules/cjs/loader:513:31)
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:911:27)
    at Function.Module._load (node:internal/modules/cjs/loader:769:27)
    at Module.require (node:internal/modules/cjs/loader:997:19)
    at require (node:internal/modules/cjs/helpers:92:18)
    at Object.<anonymous> (/Users/james/dev/webdev/phd-sapper/node_modules/rollup-plugin-svelte/index.js:11:4) {
  code: 'ERR_PACKAGE_PATH_NOT_EXPORTED'
}
error Command failed with exit code 1.

I have tried using the package.json from the npx command here: https://github.com/pngwn/sapper-mdsvex-template
but I still get the error after trashing node_modules the yarn.lock and reinstall all the modules with yarn. Default projects work, but I cannot seem to figure out where my project differs.

You can view the code here:

https://github.com/jamesb93/phd-sapper

@pngwn
Copy link
Owner

pngwn commented Jan 30, 2021

This looks like a problem caused by a more recent node version.

Could you try updating your svelte version to latest and seeing if this error persists?

@jamesb93
Copy link
Author

I tried yarn upgrade svelte and yarn upgrade svelte --latest with no luck. I think you are right though, I did brew update && brew upgrade recently so thats the only moving part here.

@jamesb93
Copy link
Author

Oh, and yes. I am using node 15.7.

@pngwn
Copy link
Owner

pngwn commented Jan 31, 2021

Could you also try updating rollup-plugin-svelte? That seems to be source of the error.

I know what this is, I'm just not sure where it is coming from. I'll debug a little more later with a later version of node.

@jamesb93
Copy link
Author

Okay some progress! These warnings appear amongst some recommendations on unused CSS.

[rollup-plugin-svelte] Unknown "dev" option. Please use "compilerOptions" for any Svelte compiler configuration.
[rollup-plugin-svelte] Unknown "hydratable" option. Please use "compilerOptions" for any Svelte compiler configuration.
[rollup-plugin-svelte] Unknown "hydratable" option. Please use "compilerOptions" for any Svelte compiler configuration.
[rollup-plugin-svelte] Unknown "generate" option. Please use "compilerOptions" for any Svelte compiler configuration.
[rollup-plugin-svelte] Unknown "dev" option. Please use "compilerOptions" for any Svelte compiler configuration.

And my site now shows:

image

@pngwn
Copy link
Owner

pngwn commented Jan 31, 2021

The plot thickens.

@jamesb93
Copy link
Author

Indeed! Let me know what else to try and test if you have the time to spare.

@jamesb93
Copy link
Author

Oh and some more info from the same error:

Error: Cannot find module '/Users/james/dev/webdev/phd-sapper/__sapper__/dev/server/server.js'
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:925:15)
    at Function.Module._load (node:internal/modules/cjs/loader:769:27)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:76:12)
    at node:internal/main/run_main_module:17:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

@jamesb93
Copy link
Author

jamesb93 commented Feb 2, 2021

Would it be worth me just rolling back Node to a version you know works?

@jamesb93
Copy link
Author

jamesb93 commented Feb 3, 2021

Okay I rolled back to 14.15.4 x64 builds. I then found this issue which details the same issue. Updating rollup-plugin-svelte to 6.1.1 fixed the problem, while updating to the latest did not.

@jamesb93
Copy link
Author

jamesb93 commented Feb 9, 2021

Going to close this as it seems its about managing the Rollup/Svelte version appropriately :)

@jamesb93 jamesb93 closed this as completed Feb 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants