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
Can't run the skeleton app (created with npm create svelte@latest my-app) in production with node build using adapter-node.
Reproduction
# npm create svelte@latest my-app
# cd my-app && npm install && npm install @sveltejs/adapter-node
# [change svelte.config.js to use adapter-node]
# npm run build
# rm -rf node_modules
# npm install --omit=dev
# node build
node:internal/errors:477
ErrorCaptureStackTrace(err);
^
Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'devalue' imported from my-app/build/server/index.js
at new NodeError (node:internal/errors:387:5)
at packageResolve (node:internal/modules/esm/resolve:909:9)
at moduleResolve (node:internal/modules/esm/resolve:958:20)
at defaultResolve (node:internal/modules/esm/resolve:1173:11)
at nextResolve (node:internal/modules/esm/loader:173:28)
at ESMLoader.resolve (node:internal/modules/esm/loader:852:30)
at ESMLoader.getModuleJob (node:internal/modules/esm/loader:439:18)
at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:76:40)
at link (node:internal/modules/esm/module_job:75:36) {
code: 'ERR_MODULE_NOT_FOUND'
}
Node.js v18.7.0
Logs
node:internal/errors:477
ErrorCaptureStackTrace(err);
^
Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'devalue' imported from my-app/build/server/index.js
at new NodeError (node:internal/errors:387:5)
at packageResolve (node:internal/modules/esm/resolve:909:9)
at moduleResolve (node:internal/modules/esm/resolve:958:20)
at defaultResolve (node:internal/modules/esm/resolve:1173:11)
at nextResolve (node:internal/modules/esm/loader:173:28)
at ESMLoader.resolve (node:internal/modules/esm/loader:852:30)
at ESMLoader.getModuleJob (node:internal/modules/esm/loader:439:18)
at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:76:40)
at link (node:internal/modules/esm/module_job:75:36) {
code: 'ERR_MODULE_NOT_FOUND'
}
Node.js v18.7.0
It is a duplicate of #3176. devalue (among other things) are now prod dependencies of @sveltejs/kit (a dev dependency). SvelteKit no longer bundling its own dependencies just made that problem more noticeable.
Then shouldn’t we update adapter-node documentation so that it does not recommend to run npm ci —prod to serve the build? That is really misleading as node build/ doesn’t work straight away contrary to what it suggests.
Describe the bug
Can't run the skeleton app (created with
npm create svelte@latest my-app
) in production withnode build
using adapter-node.Reproduction
Logs
System Info
System: OS: macOS 12.5 CPU: (8) arm64 Apple M1 Memory: 81.00 MB / 8.00 GB Shell: 5.8.1 - /bin/zsh Binaries: Node: 18.7.0 - /opt/homebrew/bin/node npm: 8.15.0 - /opt/homebrew/bin/npm Browsers: Chrome: 104.0.5112.79 Firefox: 102.0.1 Safari: 15.6 npmPackages: @sveltejs/adapter-node: ^1.0.0-next.86 => 1.0.0-next.86
Severity
blocking an upgrade
Additional Information
Seems to be solved by installing the "devalue" package.
Not a duplicate of #3176, but related to #5944
The text was updated successfully, but these errors were encountered: