Help with Tailwind Config

I'm really struggling getting Filament to work with my existing Livewire setup. NPM is throwing this error: Internal server error: [postcss] 'import' and 'export' may appear only with 'sourceType: module' (4:0)
No description
Solution:
add "type": "module" to your package.json
Jump to solution
13 Replies
Solution
awcodes
awcodes2y ago
add "type": "module" to your package.json
awcodes
awcodes2y ago
then rename postcss.config.js to postcss.config.cjs
ryanhayden
ryanhaydenOP2y ago
I'm sorry but where do you add the type:module in package.json? To tailwind?
ryanhayden
ryanhaydenOP2y ago
Ok, I just added it to the root and changed the name. Now I'm getting this error. "Laravel is not a function"
No description
awcodes
awcodes2y ago
No description
awcodes
awcodes2y ago
maybe try running an npm update
ryanhayden
ryanhaydenOP2y ago
Thank you Just did, same error.
awcodes
awcodes2y ago
if laravel isn't a function then there's something else wrong with your setup might need to remove node_modules and try a clean install could also be that you have a dependency that needs to be upgraded too.
ryanhayden
ryanhaydenOP2y ago
Figured it out. In vite.config.js I needed to change the line laravel({ to laravel.default({ Thank you so much for your help.
awcodes
awcodes2y ago
shouldn't need to do that, but if it works then great.
awcodes
awcodes2y ago
No description
ryanhayden
ryanhaydenOP2y ago
GitHub
Using "type": "module" in package.json prevents the development...
Laravel Vite Plugin Version: 0.6.0 Laravel Version: 9.27.0 Node Version: 16.14.2, 18.8.0 NPM Version: 8.5.0, 8.18.0 Vite Version: 3.0.9 Host operating system: macOS 12.5.1 Web Browser & Version...
awcodes
awcodes2y ago
interesting. i've never had that issue. oh well. 🙂

Did you find this page helpful?