F
Filamentβ€’15mo ago
ryanhayden

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
awcodesβ€’15mo ago
add "type": "module" to your package.json
awcodes
awcodesβ€’15mo ago
then rename postcss.config.js to postcss.config.cjs
ryanhayden
ryanhaydenOPβ€’15mo ago
I'm sorry but where do you add the type:module in package.json? To tailwind?
ryanhayden
ryanhaydenOPβ€’15mo 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
awcodesβ€’15mo ago
No description
awcodes
awcodesβ€’15mo ago
maybe try running an npm update
ryanhayden
ryanhaydenOPβ€’15mo ago
Thank you Just did, same error.
awcodes
awcodesβ€’15mo 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
ryanhaydenOPβ€’15mo 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
awcodesβ€’15mo ago
shouldn't need to do that, but if it works then great.
awcodes
awcodesβ€’15mo ago
No description
ryanhayden
ryanhaydenOPβ€’15mo 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
awcodesβ€’15mo ago
interesting. i've never had that issue. oh well. πŸ™‚
Want results from more Discord servers?
Add your server