sveltejs / vite-plugin-svelte

Svelte plugin for http://vitejs.dev/
MIT License
864 stars 105 forks source link

sveltejsvite-plugin-svelte laravel 9 vite 4 #567

Closed abdosaeedelhassan closed 1 year ago

abdosaeedelhassan commented 1 year ago

Describe the bug

when i tried to used i received next error

Error: Build failed with 1 error: node_modules/esbuild/lib/main.js:1357:27: ERROR: [plugin: externalize-deps] Failed to resolve entry for package "@sveltejs/vite-plugin-svelte". The package may have incorrect main/module/exports specified in its package.json: No known conditions for "." entry in "@sveltejs/vite-plugin-svelte" package

it is a fresh installation project, i don't know how to resolve this error, and need help please.

Reproduction URL

https://github.com/sveltejs

Reproduction

No response

Logs

failed to load config from /home/abdelrahman/Code/testapp/vite.config.ts
error when starting dev server:
Error: Build failed with 1 error:
node_modules/esbuild/lib/main.js:1357:27: ERROR: [plugin: externalize-deps] Failed to resolve entry for package "@sveltejs/vite-plugin-svelte". The package may have incorrect main/module/exports specified in its package.json: No known conditions for "." entry in "@sveltejs/vite-plugin-svelte" package
    at failureErrorWithLog (/home/abdelrahman/Code/testapp/node_modules/esbuild/lib/main.js:1596:15)
    at /home/abdelrahman/Code/testapp/node_modules/esbuild/lib/main.js:1052:28
    at runOnEndCallbacks (/home/abdelrahman/Code/testapp/node_modules/esbuild/lib/main.js:1468:61)
    at buildResponseToResult (/home/abdelrahman/Code/testapp/node_modules/esbuild/lib/main.js:1050:7)
    at /home/abdelrahman/Code/testapp/node_modules/esbuild/lib/main.js:1162:14
    at responseCallbacks.<computed> (/home/abdelrahman/Code/testapp/node_modules/esbuild/lib/main.js:697:9)
    at handleIncomingPacket (/home/abdelrahman/Code/testapp/node_modules/esbuild/lib/main.js:752:9)
    at Socket.readFromStdout (/home/abdelrahman/Code/testapp/node_modules/esbuild/lib/main.js:673:7)
    at Socket.emit (node:events:513:28)
    at addChunk (node:internal/streams/readable:324:12)

System Info

System:
    OS: Linux 5.19 Ubuntu 22.10 22.10 (Kinetic Kudu)
    CPU: (4) x64 Intel(R) Core(TM) i5-7500 CPU @ 3.40GHz
    Memory: 1.49 GB / 7.66 GB
    Container: Yes
    Shell: 5.2.2 - /bin/bash
  Binaries:
    Node: 19.3.0 - /usr/bin/node
    npm: 9.2.0 - /usr/bin/npm
  Browsers:
    Chromium: 108.0.5359.124
    Firefox: 108.0.1
  npmPackages:
    @inertiajs/inertia: ^0.11.1 => 0.11.1 
    @inertiajs/inertia-svelte: ^0.8.0 => 0.8.0 
    @sveltejs/vite-plugin-svelte: ^2.0.2 => 2.0.2 
    axios: ^1.1.2 => 1.2.2 
    laravel-vite-plugin: ^0.7.2 => 0.7.3 
    lodash: ^4.17.19 => 4.17.21 
    postcss: ^8.1.14 => 8.4.20 
    svelte: ^3.55.0 => 3.55.0 
    svelte-loader: ^3.1.4 => 3.1.4 
    svelte-preprocess: ^5.0.0 => 5.0.0 
    vite: ^4.0.0 => 4.0.3
dominikg commented 1 year ago

please search for existing issue reports, read our documentation and follow the instructions in our issue template.

meduzen commented 1 year ago

For those who come here using the laravel-vite-plugin, this is what helps, awaiting for the Laravel team to come up with ES module instead of CommonJS.