Have you done a production build so that the assets are there when you don't have the dev server running? npm run build
Oct 30, 2024
1
Level 9
axios not loading before laravel-precognition?
I keep getting this error in the console in my Laravel 10 +Octane +Precognition/Vue3/Vite/Inertia +SSR project:
Uncaught ReferenceError: Cannot access 'axios' before initialization
From what I can tell, laravel-precognition is trying to access axios but it isn't initialized yet... this is despite axios being attached to the window object in my bootstrap file...
When I run the vite dev server the error goes away and my project loads properly as expected. When I stop the vite dev server the error returns?!?!?! (And this error also occurs expectedly in production, where there is not vite server)
Please help!!!!!!!
Please or to participate in this conversation.