[ERROR] The file "../../node_modules/.pnpm/libphonenumber-js@1.10.41/node_modules/libphonenumber-js/examples.mobile.json.js" was loaded with the "js" loader
happysalada opened this issue · 4 comments
happysalada commented
here is the full stack trace
[ERROR] The file "../../node_modules/.pnpm/libphonenumber-js@1.10.41/node_modules/libphonenumber-js/examples.mobile.json.js" was loaded with the "js" loader
../../node_modules/.pnpm/svelte-tel-input@3.3.3_svelte@4.2.0/node_modules/svelte-tel-input/dist/utils/helpers.js:2:21:
2 │ import examples from 'libphonenumber-js/mobile/examples' assert { type: 'js...
╵ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This import assertion requires the loader to be "json" instead:
../../node_modules/.pnpm/svelte-tel-input@3.3.3_svelte@4.2.0/node_modules/svelte-tel-input/dist/utils/helpers.js:2:66:
2 │ ... examples from 'libphonenumber-js/mobile/examples' assert { type: 'json' };
╵ ~~~~~~~~~~~~
You need to either reconfigure esbuild to ensure that the loader for this file is
"json" or you need to remove this import assertion.
it looks like in the latest libphonenumber-js , they changed a bunch of path to js. The asserts have to be changed it looks like.
gyurielf commented
happysalada commented
hey, thanks for the quick reply.
I still seem to get the error with the updated 3.3.4
12:56:30 a.m. [vite-plugin-svelte] /Users/raphael/dev/mono_sweif/packages/ui/components/
12:56:30 a.m. [vite-plugin-svelte] /Users/raphael/dev/mono_sweif/packages/ui/components/
✘ [ERROR] The file "../../node_modules/.pnpm/libphonenumber-js@1.10.41/node_modules/libp
../../node_modules/.pnpm/svelte-tel-input@3.3.4_svelte@4.2.0/node_modules/svelte-tel
2 │ import examples from 'libphonenumber-js/mobile/examples' assert { type: 'js...
╵ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This import assertion requires the loader to be "json" instead:
../../node_modules/.pnpm/svelte-tel-input@3.3.4_svelte@4.2.0/node_modules/svelte-tel-input/dist/utils/helpers.js:2:66:
2 │ ... examples from 'libphonenumber-js/mobile/examples' assert { type: 'json' };
╵ ~~~~~~~~~~~~
You need to either reconfigure esbuild to ensure that the loader for this file is
"json" or you need to remove this import assertion.
12:56:32 a.m. [vite] error while updating dependencies:
Error: Build failed with 1 error:
../../node_modules/.pnpm/svelte-tel-input@3.3.4_svelte@4.2.0/node_modules/svelte-tel-input/dist/utils/helpers.js:2:21: ERROR: The file "../../node_modules/.pnpm/libphonenumber-js@1.10.41/node_modules/libphonenumber-js/examples.mobile.json.js" was loaded with the "js" loader
at failureErrorWithLog (/Users/raphael/dev/mono_sweif/node_modules/.pnpm/esbuild@0.18.20/node_modules/esbuild/lib/main.js:1649:15)
at /Users/raphael/dev/mono_sweif/node_modules/.pnpm/esbuild@0.18.20/node_modules/esbuild/lib/main.js:1058:25
at /Users/raphael/dev/mono_sweif/node_modules/.pnpm/esbuild@0.18.20/node_modules/esbuild/lib/main.js:1525:9
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
gyurielf commented
hey, thanks for the quick reply. I still seem to get the error with the updated 3.3.4
Hey!
Yes, it was a misstake. Could you try now ?
I released a new version.
happysalada commented
fixed, thanks!