-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
bug(netlify): Package subpath './hooks' is not defined by "exports" #3189
Comments
|
From lock file: Oops, the repo is private, lemme provide another accessible repo, I will update it ASAP. Thanks. |
|
exactly the same issue here in my experience the netlify adapter has always been subpar and broken/not prod ready compared to vercel which is sad :( |
But it has always been working well on my projects until the recent svelte version. |
This comment has been minimized.
This comment has been minimized.
I completely disagree @bluwy. Even with your 'fix', there is no change. This is an issue with the netlify adapter for Svelte, who else would be responsible for such an issue? |
Can you show what is the issue with the Netlify adapter? The export error doesn't make sense as we had always exported the |
Ah I think I found the culprit. In |
A very similar error still seems present in kit at version Bundling using esbuild is a workaround. See this comment for configuring your The error: {
"errorType": "Error",
"errorMessage": "Package subpath './hooks' is not defined by \"exports\" in /var/task/node_modules/@sveltejs/kit/package.json",
"trace": [
"Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './hooks' is not defined by \"exports\" in /var/task/node_modules/@sveltejs/kit/package.json",
" at new NodeError (internal/errors.js:322:7)",
" at throwExportsNotFound (internal/modules/esm/resolve.js:322:9)",
" at packageExportsResolve (internal/modules/esm/resolve.js:511:7)",
" at resolveExports (internal/modules/cjs/loader.js:450:36)",
" at Function.Module._findPath (internal/modules/cjs/loader.js:490:31)",
" at Function.Module._resolveFilename (internal/modules/cjs/loader.js:888:27)",
" at Function.Module._load (internal/modules/cjs/loader.js:746:27)",
" at Module.require (internal/modules/cjs/loader.js:974:19)",
" at require (internal/modules/cjs/helpers.js:93:18)",
" at Object.<anonymous> (/var/task/.netlify/server/app.js:61:31)"
]
} |
Can you try updating Kit and npm i -D @sveltejs/kit@next @sveltejs/adapter-netlify@next @sveltejs/adapter-auto@next |
@Mrbeyond I get a 404 when trying to access your reproduction |
@stordahl I'm not able to reproduce with this repository. I deployed the checked in code with no issues. I then removed the line |
I'm going to close this for now since there's no reproduction of it. I've also deployed my own projects to Netlify with the latest SvelteKit and didn't face any issues. We can reopen if someone provides a way to reproduce |
My issues were fixed in #3327 - I was seeing this error with the subpath './srr' not './hooks' |
Describe the bug
Sveltekit app having version "svelte": "^3.44.0" works perfectly locally but showing "errorMessage":"Package subpath './ssr' is not defined by "exports" in /var/task/node_modules/@sveltejs/kit/package.json" when deployed to production on netlify. I have tried both auto-adapter and explicit netlify adapter but the error persists.
Reproduction
Repo link:
https://github.com/Mrbeyond/pubside
Logs
System Info
Severity
annoyance
Additional Information
No response
The text was updated successfully, but these errors were encountered: