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)
13 Replies
Solution
add "type": "module" to your package.json
then rename
postcss.config.js
to postcss.config.cjs
I'm sorry but where do you add the type:module in package.json?
To tailwind?
Ok, I just added it to the root and changed the name. Now I'm getting this error. "Laravel is not a function"
maybe try running an
npm update
Thank you
Just did, same error.
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.Figured it out. In vite.config.js I needed to change the line
laravel({
to laravel.default({
Thank you so much for your help.shouldn't need to do that, but if it works then great.
Looks like a known issue:
https://github.com/laravel/vite-plugin/issues/136
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...
interesting. i've never had that issue.
oh well. π