-
Notifications
You must be signed in to change notification settings - Fork 154
Using "type": "module"
in package.json
prevents the development server from starting
#136
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@nhedger what is the benefit of adding that key to the |
I don't think that's a setting you need for building an app but rather for NPM packages. Just stick to the defaults when building a Laravel app. |
Removing this key from package.json gives the following error:
|
Please follow along with this PR which is attempting to address this issue: #189 If you can test this PR to confirm it fixes your issue that would be greatly appreciated. Instructions on how to test are in the comments. |
checkout this workaround #189 (comment) |
This workaround doesn't work with |
Add above: |
16.14.2
,18.8.0
8.5.0
,8.18.0
Description:
Declaring
"type": "module"
in the rootpackage.json
prevents the development server from starting with the following error.Steps To Reproduce:
laravel new vite-plugin-issue
npm install
npm run dev
and see that the Vite development server starts correctly"type": "module"
topackage.json
npm run dev
and see that the Vite development server fails to startReproduction repository
The following repository contains a reproduction of this issue.
And here's the specific commit that reveals the issue.
Related
I believe (closed) issue #130 is related
Solution
Create ES and CJS outputs and reference them in
package.json
, similarly to what is done in https://github.com/innocenzi/laravel-vite/tree/main/vite-plugin-laravel.I'm happy to submit a PR that will update the build system and fix the issue; let me know how you want to proceed.
The text was updated successfully, but these errors were encountered: