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
Describe the bug kit is importing relative to its location in node_modules, not relative to the initialized project:
UnhandledPromiseRejectionWarning: Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'C:\Users\GrygrFlzr\Documents\projects\sk-35\node_modules\@sveltejs\kit\node_modules\@sveltejs\vite-plugin-svelte\' imported from C:\Users\GrygrFlzr\Documents\projects\sk-35\node_modules\@sveltejs\kit\dist\index2.js
Note \node_modules\@sveltejs\kit\node_modules\@sveltejs\vite-plugin-svelte\ instead of \node_modules\@sveltejs\vite-plugin-svelte\.
To Reproduce
# initialize a new project# install vite to work around #412
$ npm run dev
> sk-35@0.0.1 dev C:\Users\GrygrFlzr\Documents\projects\sk-35
> svelte-kit dev
(node:304) UnhandledPromiseRejectionWarning: Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'C:\Users\GrygrFlzr\Documents\projects\sk-35\node_modules\@sveltejs\kit\node_modules\@sveltejs\vite-plugin-svelte\' imported from C:\Users\GrygrFlzr\Documents\projects\sk-35\node_modules\@sveltejs\kit\dist\index2.js
at legacyMainResolve (internal/modules/esm/resolve.js:225:9)
at packageResolve (internal/modules/esm/resolve.js:648:14)
at moduleResolve (internal/modules/esm/resolve.js:696:18)
at Loader.defaultResolve [as _resolve] (internal/modules/esm/resolve.js:810:11)
at Loader.resolve (internal/modules/esm/loader.js:86:40)
at Loader.getModuleJob (internal/modules/esm/loader.js:230:28)
at ModuleWrap.<anonymous> (internal/modules/esm/module_job.js:56:40)
at link (internal/modules/esm/module_job.js:55:36)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:304) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async functionwithout a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
(node:304) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Expected behavior
Load dependencies from the correct directory
Information about your SvelteKit Installation:
npmPackages:
@sveltejs/kit: next => 1.0.0-next.35
svelte: ^3.29.0 => 3.35.0
Severity
Completely unusable without monkey-patching @sveltejs/kit.
Additional context
In not-svelte-kit I fixed this issue by using import-meta-resolve, but I'm a bit more hesitant to add a new dependency to the official solution.
Workaround: Run npm run build inside node_modules\@sveltejs\kit\node_modules\@sveltejs\vite-plugin-svelte.
The text was updated successfully, but these errors were encountered:
I think this is correct — vite-plugin-svelte is a dependency of Kit, not the project that uses it. I think the problem is that the vite-plugin-svelte package doesn't include the index.js, inexplicably. Fixed that in 8a9fcd6#diff-9b4d1e1724c3935da1984287277aace763e8a724298cb3b0c9db6d444d0d763a but now I'm struggling to convince npm to install that version in my project, I think because pnpm pins dependency versions when it publishes packages. Will cut a new Kit version to work around it
Describe the bug
kit
is importing relative to its location innode_modules
, not relative to the initialized project:UnhandledPromiseRejectionWarning: Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'C:\Users\GrygrFlzr\Documents\projects\sk-35\node_modules\@sveltejs\kit\node_modules\@sveltejs\vite-plugin-svelte\' imported from C:\Users\GrygrFlzr\Documents\projects\sk-35\node_modules\@sveltejs\kit\dist\index2.js
Note
\node_modules\@sveltejs\kit\node_modules\@sveltejs\vite-plugin-svelte\
instead of\node_modules\@sveltejs\vite-plugin-svelte\
.To Reproduce
Expected behavior
Load dependencies from the correct directory
Information about your SvelteKit Installation:
Severity
Completely unusable without monkey-patching @sveltejs/kit.
Additional context
In
not-svelte-kit
I fixed this issue by usingimport-meta-resolve
, but I'm a bit more hesitant to add a new dependency to the official solution.Workaround: Run
npm run build
insidenode_modules\@sveltejs\kit\node_modules\@sveltejs\vite-plugin-svelte
.The text was updated successfully, but these errors were encountered: