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
I'm trying to migrate a svelte app from vite to farm but I encounter some node_module import error, example:
[ Farm ] Error: Failed to build: Error: Can not load `node_modules/svelte-portal/src/Portal.svelte`. Original error:
None.
Potential Causes:
1.This kind of module is not supported, you may need plugins to support it.
Can not load `node_modules/svelte-select/Select.svelte`. Original error:
None.
Potential Causes:
1.This kind of module is not supported, you may need plugins to support it.
Can not load `node_modules/svelte-range-slider-pips/dist/svelte/components/RangeSlider.svelte`. Original error:
None.
Potential Causes:
1.This kind of module is not supported, you may need plugins to support it.
Can not resolve `leaflet` from src/component/chart/faultMap/FaultMap.svelte.
Original error: None.
Potential Causes:
1.The file that `leaflet` points to does not exist.
2.Install it first if`leaflet` is an dependency from node_modules, if you are using pnpm refer to [https://pnpm.io/faq#pnpm-does-not-work-with-your-project-here] for solutions.
3. If `leaflet` is a alias, make sure your alias config is correct.
So I decided to check how the vite-adapter-svelte example handle imports in svelte file.
But are you sure the vite-adapter-svelte still works ? Because when I fork and try to launch it, I can't:
cd examples/vite-adapter-svelte
yarn install
yarn build
output:
yarn run v1.22.19
$ farm build
[ Farm ] Using config file at /project/workspace/examples/vite-adapter-svelte/farm.config.ts
[ Farm ] Error: Failed to load config file: Cannot find package 'vite' imported from /project/workspace/examples/vite-adapter-svelte/node_modules/@sveltejs/vite-plugin-svelte-inspector/src/index.js
Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'vite' imported from /project/workspace/examples/vite-adapter-svelte/node_modules/@sveltejs/vite-plugin-svelte-inspector/src/index.js
at packageResolve (node:internal/modules/esm/resolve:854:9)
at moduleResolve (node:internal/modules/esm/resolve:927:18)
at defaultResolve (node:internal/modules/esm/resolve:1157:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:390:12)
at ModuleLoader.resolve (node:internal/modules/esm/loader:359:25)
at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:234:38)
at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:87:39)
at link (node:internal/modules/esm/module_job:86:36)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
If I add vite, it goes worse.
Reproduce link
No response
What is actually happening?
Can't figure out how to resolve the these node_modules imports error in Svelte
Steps to reproduce
I'm trying to migrate a svelte app from vite to farm but I encounter some node_module import error, example:
So I decided to check how the vite-adapter-svelte example handle imports in svelte file.
But are you sure the vite-adapter-svelte still works ? Because when I fork and try to launch it, I can't:
cd examples/vite-adapter-svelte
yarn install
yarn build
output:
If I add vite, it goes worse.
Reproduce link
No response
What is actually happening?
Can't figure out how to resolve the these node_modules imports error in Svelte
System Info
The text was updated successfully, but these errors were encountered: