-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Description
Describe the bug
When running npm run build on a project that uses RxJS I get the following error:
Directory import '/Users/evert/Sites/svelte-kit-tailwind-jit/node_modules/rxjs/operators' is not supported resolving ES modules imported from /Users/evert/Sites/svelte-kit-tailwind-jit/.svelte/output/server/app.js
Did you mean to import rxjs/dist/cjs/operators/index.js?
If I indeed manually change that line in /.svelte/output/server/app.js from this:
import {share, filter, map, finalize} from "rxjs/operators";To this:
import {share, filter, map, finalize} from "rxjs/dist/cjs/operators/index.js";then I can successfully run npm run start and everything works.
To Reproduce
Just install RxJS and import some operators somewhere. I tested this on kit version 1.0.0-next.55.
Expected behavior
This to just work without a hitch.
Stacktrace
Stack trace
Error [ERR_UNSUPPORTED_DIR_IMPORT]: Directory import '/Users/evert/Sites/svelte-kit-tailwind-jit/node_modules/rxjs/operators' is not supported resolving ES modules imported from /Users/evert/Sites/svelte-kit-tailwind-jit/.svelte/output/server/app.js
Did you mean to import rxjs/dist/cjs/operators/index.js?
at new NodeError (node:internal/errors:329:5)
at finalizeResolution (node:internal/modules/esm/resolve:319:17)
at moduleResolve (node:internal/modules/esm/resolve:758:10)
at Loader.defaultResolve [as _resolve] (node:internal/modules/esm/resolve:869:11)
at Loader.resolve (node:internal/modules/esm/loader:86:40)
at Loader.getModuleJob (node:internal/modules/esm/loader:230:28)
at ModuleWrap. (node:internal/modules/esm/module_job:57:40)
at link (node:internal/modules/esm/module_job:56:36)
Information about your SvelteKit Installation:
The output of `npx envinfo --system --npmPackages svelte,@sveltejs/kit --binaries --browsers`
System:
OS: macOS 11.2.3
CPU: (8) x64 Apple M1
Memory: 19.48 MB / 16.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 15.8.0 - ~/.nvm/versions/node/v15.8.0/bin/node
Yarn: 1.22.10 - ~/.nvm/versions/node/v15.8.0/bin/yarn
npm: 7.6.1 - ~/.nvm/versions/node/v15.8.0/bin/npm
Browsers:
Chrome: 89.0.4389.90
Safari: 14.0.3
npmPackages:
@sveltejs/kit: ^1.0.0-next.55 => 1.0.0-next.55
svelte: ^3.29.0 => 3.35.0
-
My browser: Chrome
-
My adapter: adapter-node
Severity
For now I'm just playing around with SvelteKit. So it's okay with me if I can't run npm run build as long as I can run npm run dev, which for now seems to be working fine.