-
-
Notifications
You must be signed in to change notification settings - Fork 386
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
TypeError: Failed to fetch dynamically imported module #157
Comments
Thank you for your contribution. We will check and reply to you as soon as possible. |
Can you give me a little more information on what you mean by injecting some HTML? |
@Jonghakseo sure! You can actually check out the entire repo here. The file in question is in Specifically, in that file, I'm add a React component via the addIconToComposeWindow() function inside the render() function. As far as I can tell, the only file that is being dynamically imported is from your boilerplate code, here. Based on the comment in that file, it seems like this has to be done. But it also causes that error:
Again, it only happens about 10% of the time and seemingly at random so it's difficult to reproduce. But any ideas on how to fix the issue would be greatly appreciated. |
As additional context, it seems like the only time this happens is upon making a file change. The webpage reloads automatically and executes the rollup (via the So I'm guessing this would not affect anything in production because there won't be any changes to the files, but it serves as a minor inconvenience in development. I'm new to Vite and Chrome Extensions though, so if there is anything above that doesn't add up or make sense, please help me to understand. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
I encountered the same problem on my vite project,has this problem been solved? |
I apologise for the delay in responding. Let's take a look. |
I found customDynamicImport doesn't work with await import, here is error:
and this will resolve my problem
|
I've been testing with the solution you suggested and it seems to be working well. I'll raise a PR to reflect it, unless you have any other comments. |
@all-contributors please add @lookis for bug |
I've put up a pull request to add @lookis! 🎉 |
@all-contributors please add @lookis for code |
I've put up a pull request to add @lookis! 🎉 |
@all-contributors please add @chrisozgo99 for bug |
I've put up a pull request to add @chrisozgo99! 🎉 |
I'm getting the following error when trying to inject some HTML via this chrome extension boilerplate:
Uncaught (in promise) TypeError: Failed to fetch dynamically imported module: chrome-extension://{my-extension-id}/assets/js/index.js
It only happens about 10% of the time, which is strange. I think it has something to do with the Vite configuration, although, it is difficult to debug with it only happening occasionally.
Might it have something to do with the customDynamicImport() function, or some other custom configuration of this boilerplate? Any help would be appreciated!
The text was updated successfully, but these errors were encountered: