TypeError: Failed to fetch dynamically imported module
See original GitHub issueWhat happened?
Unable to cache pwa-camera-modal.entry.js
TypeError: Failed to fetch dynamically imported module:
yarn add @ionic/pwa-elements
boot/capacitor.ts
import { defineCustomElements } from '@ionic/pwa-elements/loader';
export default async () => {
await defineCustomElements(window);
};
https://127.0.0.1:8008/node_modules/.q-cache/vite/spa/pwa-camera-modal.entry.js
What did you expect to happen?
able to use capacitor camera on the web
Reproduction URL
no link
How to reproduce?
install
1: yarn add @ionic/pwa-elements
2: Add capacitor.ts to quasar.config.js boot
3: quasar d
4: test the capacitor camera on web you it wont work
Flavour
Quasar CLI with Vite (@quasar/cli | @quasar/app-vite)
Areas
SPA Mode
Platforms/Browsers
Chrome
Quasar info output
No response
Relevant log output
No response
Additional context
No response
Issue Analytics
- State:
- Created 2 years ago
- Comments:13 (6 by maintainers)
Top Results From Across the Web
Failed to fetch dynamically imported module" on Vue/Vite ...
We have a vanilla Vue/Vite setup and I'm receiving TypeError: Failed to fetch dynamically imported module on sentry logs.
Read more >TypeError: Failed to fetch dynamically imported module #5003
Describe the bug I found, if I use this to run build, then the manifest.json file will don't include the dynamicImports, and in...
Read more >failed to fetch dynamically imported module vue - You.com
If you are trying to dynamically import a module in Vue and getting the error "Failed to fetch dynamically imported module", it is...
Read more >Error: Failed to fetch dynamically Dashboard imported module
Error: Failed to fetch dynamically Dashboard imported module · Uninstall TBM · Go to installation folder and delete everything except: \resources\ ...
Read more >Blazor Webassembly - "Failed to fetch dynamically imported ...
TypeError : Failed to fetch dynamically imported module: https://localhost:7082/_framework/blazor-hotreload.js)". Attachments: image2.png. image1.png.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi,
It’s been a while since this issue was raised (and closed) but I have experienced the same issue. It seems that the file, “pwa-camera-modal.entry.js” is not in the location it is expected. http://localhost:9000/node_modules/.q-cache/vite/spa/deps/pwa-camera-modal.entry.js.
The camera example on this page, https://quasar.dev/quasar-cli-vite/developing-capacitor-apps/capacitor-api does not work. I understand it is not a priority but it would be great if you could take a look at the issue.
Yes, It is possible to load the files from node_modules folder:
<script type="module" src="node_modules\@ionic\pwa-elements\dist\ionicpwaelements\ionicpwaelements.esm.js" ></script> <script nomodule src="node_modules\@ionic\pwa-elements\dist\ionicpwaelements\ionicpwaelements.js" ></script>