question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TypeError: Failed to fetch dynamically imported module

See original GitHub issue

What 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:closed
  • Created 2 years ago
  • Comments:13 (6 by maintainers)

github_iconTop GitHub Comments

3reactions
paladyne-iocommented, Nov 3, 2022

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.

image
1reaction
bruno-pycommented, Dec 20, 2022

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>

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found