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

Error: Package subpath './compiler.js' is not defined by "exports" in node_modules/svelte/package.json #7

Closed
MariusStuparu opened this issue Nov 11, 2020 · 9 comments
Labels
bug Something isn't working

Comments

@MariusStuparu
Copy link

Describe the bug
Fresh deploy of the generator on MacOS Catalina and Node v14.3.0. Trying to run the build or dev scripts, rollup fails with this error:

[!] Error: Package subpath './compiler.js' is not defined by "exports" in node_modules/svelte/package.json

Logs

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './compiler.js' is not defined by "exports" in node_modules/svelte/package.json
    at applyExports (internal/modules/cjs/loader.js:497:9)
    at resolveExports (internal/modules/cjs/loader.js:513:23)
    at Function.Module._findPath (internal/modules/cjs/loader.js:641:31)
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:1016:27)
    at Function.Module._load (internal/modules/cjs/loader.js:898:27)
    at Module.require (internal/modules/cjs/loader.js:1089:19)
    at require (internal/modules/cjs/helpers.js:73:18)
    at Object.<anonymous> (node_modules/rollup-plugin-svelte/index.js:11:4)
    at Module._compile (internal/modules/cjs/loader.js:1200:30)
    at Module._extensions..js (internal/modules/cjs/loader.js:1220:10)

Platform:

  • OS: OSX Catalina
  • Generator version: 2.2.8
  • Node version: 14.3.0
  • NPM version: 5.3.0
@MariusStuparu MariusStuparu added the bug Something isn't working label Nov 11, 2020
@MariusStuparu
Copy link
Author

MariusStuparu commented Nov 11, 2020

There was a breaking change introduced in Svelte sveltejs/svelte#5665

The fix is to update rollup-plugin-svelte to version 6.1.1

...
"rollup-plugin-svelte": "~6.1.1",

Couldn't create a fix branch on the repo, please update yourself.

@Samuel-Martineau
Copy link
Owner

Thanks for your help! I’m fixing the template

styfle added a commit to vercel/vercel that referenced this issue Nov 11, 2020
Updated the template using `npx degit sveltejs/template my-svelte-project`

I also added a `yarn.lock` file so dependencies don't break for future deployments.

Related to Samuel-Martineau/generator-svelte#7
@Samuel-Martineau
Copy link
Owner

It should be fixed right now as all the tests pass. You should upgrade to [email protected].

Thanks for using generator-svelte!

@elimisteve
Copy link

elimisteve commented Jan 3, 2021

FYI I didn't run into this with Node 10.x (10.23, specifically), but just upgraded to Node 12.x (12.20.0) then suddenly did.

@Samuel-Martineau
Copy link
Owner

But does it work now with node 12?

@elimisteve
Copy link

Yes, the above fix worked (upgrading to 6.1.1), I'm just adding that I didn't get the "Package subpath" error at all when using Node 10.

candywater pushed a commit to candywater/svelte-color that referenced this issue Jan 17, 2021
chore: 🤖 upgrade two plugins

chore: 🤖 upgrade all version

Samuel-Martineau/generator-svelte#7

fix: 🐛 fix all error in svelte3
@jeffRTC
Copy link

jeffRTC commented Jan 20, 2021

Goddamn. The whole ecosystem is rigged, rigged and should follow Windows Philosophy of backwards compatibility.

It's been a year since I wrote my app and it already broken.

WTF with X-Gen!!!!!

@sutin1234
Copy link

work for me
#7 (comment)

@arb1ona
Copy link

arb1ona commented Aug 10, 2021

There was a breaking change introduced in Svelte sveltejs/svelte#5665

The fix is to update rollup-plugin-svelte to version 6.1.1

...
"rollup-plugin-svelte": "~6.1.1",

Couldn't create a fix branch on the repo, please update yourself.

Thank youu! It worked <3

fatihmert added a commit to fatihmert/svelte-phaser that referenced this issue Aug 20, 2021
Solve this; `Error: Package subpath './compiler.js' is not defined by "exports" in node_modules/svelte/package.json`

[Source](Samuel-Martineau/generator-svelte#7 (comment))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants