Vite works with blade files, how are you using these libaries in the blade files? You might be doing something wrong.
Feb 6, 2024
2
Level 1
Need help with using javascript libraries in blade files
I am using Laravel 9 which comes with Vite instead of Mix. I have imported a couple of javascript libraries in my laravel bootatrap.js file and i know you have to use "import" with Vite instead of "require" but i get a undefined function error in the browser console when using the libraries inside blade files, even though the function works in the console.
I read somewhere on the internet that Vite does not work with blade files. Is this true?
Is this even a problem with Vite or is it something else?
Any help is greatly appreciated. Thanks.
Please or to participate in this conversation.