Top-level await is not available (using inertia starter kit) #4476
-
I'm using the Inertia Starter Kit (with Vue). When running 'npm run dev' I get the following errors:
And when trying to load a Inertia route, I the app crashes:
Note: the 'npm run lint' and the 'npm run build' runs without any errors. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
logs you see are produced by Vite. Look at what Vite is trying to compile: some backend/Adonis code. If you're importing Adonis code into your frontend, I guess it's probably to share some typing. In this case, don't forget to use |
Beta Was this translation helpful? Give feedback.
logs you see are produced by Vite. Look at what Vite is trying to compile: some backend/Adonis code.
So you are importing Adonis code into your frontend. That means you will bundle your backend with your frontend. I guess this is not what you want.
If you're importing Adonis code into your frontend, I guess it's probably to share some typing. In this case, don't forget to use
import type
rather thanimport