Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

AboutToJumpOffABuilding's avatar

Compiling Assets Using Vite (?)

Hi All! I'm trying to use a javascript library to my Laravel 9 project that uses vite. The Javascript library I'm trying to us is (if this helps) is "locomotive scroll" and how I arrived in this situation is that whenever I run the project it doesn't work and when I check the console I get this error

"Uncaught TypeError: Error resolving module specifier “locomotive-scroll”. Relative module specifiers must start with “./”, “../” or “/”."

Reason for that, if I'm not mistaken is because I need to compile my assets (?) so that I could run. I would turnover to laravel mix but the project is in too deep and I've exhausted 90% of my braincells trying to read and understand the docs.

I installed the library through npm and currently have a "locomotive.js" in my "public/js" folder where the console points the error to. I never post on forums because I feel like all my questions are dumb but I really hope someone anyone here could help ;-;

0 likes
0 replies

Please or to participate in this conversation.