Closed Specy closed 2 years ago
This is an example of what happens:
There are no erorrs, everything is loaded correctly
Please upload your project for me to reproduce.
https://github.com/Specy/asm-editor
Here is the repository, I currently commented out the plugin to publish the website but it can just be decommented in the vite config, during development there are no issues, only after building. You can do that by installing dependencies and running npm run build
and then npm run preview
I set the build target to esnext to be able to publish the website for now
Current Website is hosted at https://asm-editor.specy.app/
Oh I'm not familiar with the frameworks in your project. I'm afraid that I can't investigate this issue...
Could you try finding what caused it? Does the code flow hang or lost in some framework code?
I'm gonna try to check tomorrow, but i'm not sure if i'll be able to find it, i'll let you know
Having a quick look at the code, in this test here: https://github.com/Menci/vite-plugin-top-level-await/blob/8191ae5ba2b44e008f85023b5219d04f19fbfcad/src/transform.spec.ts#L46 and in the makeTryCatch
methods, the catch clause is empty, I'm thinking, might it be silently ignoring the error?
Yes, but silently ignoring the exception and skipping awaiting when importing a cyclic dependency with TLA is the expected behavior here. To check if I'm wrong we can modify here to log the caught error.
Why is it expected? Looking at the top level await spec it seems like the default behaviour is to not do anything which will cause a dead lock. You could try to add a console log of the error in the catch clause so to debug it tho. I'm not sure if this is my issue but it's the first thing which might come to mind
I have fixed this issue and will push the changes later. But It's actually nothing to do with that try-catch.
Fixed in v1.2.1
.
Ty! it works now
I'm having an issue in my sveltekit app where a dynamic page, when first loaded, gives a blank page, if i go back and visit again then it shows correctly.
I removed the top level await plugin and the route works so i'm guessing the issue is coming from there, i'm also using the wasm vite plugin. Is there some configuration i need to do or is this expected?