-
-
Notifications
You must be signed in to change notification settings - Fork 111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"dynamicImportDefault" doesnot work as expected #47
Comments
Thank you for reporting this issue.
This is the exact same message as in this issue windicss/vite-plugin-windicss#167 @SOVLOOKUP can you try to reproduce this error with the vite svelte template cc @pi0 is there anything in jiti that could cause this? |
use vite svelte template only is ok: https://github.com/midwayjs/hooks/blob/master/examples/svelte This is a compatibility bug, which causes the esm module cannot be imported properly in I have solved this problem by using tsup to make pulgin compatible with cjs and esm. #49 @dominikg |
Hi @SOVLOOKUP. Confirming issue and trying with
Jiti is in stack trace most probably because of |
|
should be fixed by #54 |
1.0.0-next.11has been released and sveltekit uses it. please try |
thanks very much~ |
Description
I am using svelte kit with midway/hooks which needs a vite plugin to work.
But when importing the plugin in
svelte.config.js
, "dynamicImportDefault" function will fail with err:> A dynamic import callback was not specified.
I found the problem is:
Dynamic
import
can only work in ES module file. So after tsc compiling, "dynamicImportDefault" function won't work as expected indist/index.js
(a cjs file).Reproduction
https://github.com/SOVLOOKUP/midway-svelte
The text was updated successfully, but these errors were encountered: