QwikDev/astro

uncaught (in promise) TypeError: Failed to fetch dynamically imported module:

Closed this issue · 4 comments

Hi team. I'm using the following packages / versions

  • "@builder.io/qwik": "^1.2.17",
  • "@qwikdev/astro": "^0.1.16",

And all is well when running yarn dev, but when running yarn build and then yarn preview i see the following errror:

uncaught (in promise) TypeError: Failed to fetch dynamically imported module:

Reproduction repo on the feat/add-quik branch here: simple-sidebar-navigation-astro/tree/feat/add-quik

There should now be a click handler on the burger menu (resize your browser to a smaller screen size), which doesn't work in "prod". Also seeing a 404 for the favicon which might be releated.

I have two other branches in that repo that you can use for reference. One uses vanilla Js, the other uses React. All three branches have the same functionality, just implemented using different flavours of JavaScript.

75795b7063f566cd32db639b5428992f.mp4

Seems to be working fine for me in both yarn dev and preview. same with npm on the feat/add-quik branch. Did you run yarn install since the last change?

https://github.com/thejackshelton/astro/blob/main/libs/qwikdev-astro/src/index.ts#L34

Wondering if your entryDir locally might be causing an issue. If you want to use npm instead here and play with @qwikdev/astro/src/index.ts in node_modules and log out what paths you get:

For example, if you do

entrypoints = getQwikEntrypoints('./src', filter);

with npm specifically in node_modules, and run the build. Does it work?

Thanks @thejackshelton , it must be something weird going on locally. I deployed to Netlify, and it works just fine. Sorry for the trouble! https://simple-sidebar-navigation-astro-quik.netlify.app/

Thanks @thejackshelton , it must be something weird going on locally. I deployed to Netlify, and it works just fine. Sorry for the trouble! https://simple-sidebar-navigation-astro-quik.netlify.app/

Could you try making a reproduction with a new empty astro app, the qwik integration, a qwik counter component, and see if you get the same problem?

It may be an entryDir issue with the integration.

Going to close since I can't reproduce this error. Happy to reopen it if you find anything interesting @PaulieScanlon!