Oct 20, 2024
0
Level 9
Cannot access axios before initialization?
My build stack: Laravel 10 +Octane +Precognition/Vue3/Vite/Inertia +SSR
Trying to figure out how to mitigate the use of axios from within laravel-precognition without breaking my application... When running the vite dev server, my app loads and works 100% properly, but when I access my app without the vite server running (like in production for example), I get the following error (coming from within the laravel precognition source code after it's bundled into my app):
let axiosClient = axios.create();
^
ReferenceError: Cannot access 'axios' before initialization
Please or to participate in this conversation.