Closed adityar15 closed 10 months ago
Hey there,
Can you first please try one of the support channels below? If you can actually identify this as a bug, feel free to open up a new issue with a link to the original one and we'll gladly help you out.
Thanks!
I was getting the same error. The solution for me was:
You've upgraded to a new major version that has breaking changes.
Please see the upgrade guide: https://github.com/laravel/vite-plugin/blob/1.x/UPGRADE.md
@timacdonald thanks for the link. I tried the upgrade guide. The error goes off after renaming postcss and tailwind.config.js to .cjs extensions and adding type:"module" in package.json But the problem now is Vue templates are not rendered correctly in terms of slots. The slot renders plain HTML string rather than the content itself.
@adityar15 I can see you also updated the @vitejs/plugin-vue
version. Make sure to check their breaking changes: https://github.com/vitejs/vite-plugin-vue/blob/main/packages/plugin-vue/CHANGELOG.md
Are you using require
syntax in your vite.config.js
? Can you share you config?
Ran into this as well.
Not using require
anywhere. All I did was upgrade to vite ^5.0.0 (alongside @vitejs/plugin-vue ^5.0.0 and laravel-vite-plugin ^1.0.1)
I added "type": "module",
to my package.json
which would have been the end of it, but then got errors from tailwindcss/postcss configs. Instead of renaming to .cjs which seems like delaying the inevitable, I just replaced module.exports = {
in both files with export default {
so that they were valid ESM configs. Problem solved.
@bcorcoran think we have that all covered in the upgrade guide.
I'll close this one as I don't think it is related to the plugin itself. If you have any other insights, @adityar15, let us know.
- "type": "module"
worked for me too
Vite Plugin Version
1.0.1
Laravel Version
10.39.0
Node Version
21.2.0
NPM Version
10.2.3
Operating System
macOS
OS Version
14.2.1
Web browser and version
Google Chrome Latest Version
Running in Sail?
No
Description
It was all running well until I updated my npm packages.
Previously I was using
When I ran
It updated all my packages to the below versions
Whenever I run npm run serve Or npm run build
I am getting this error
What I have tried that didn't work:
Any help will be massively appreciated :D
Steps To Reproduce
Upgraded packages in package.json using npm-check-updates