Next.js Discord

Discord Forum

Module not found with experimental urlImports (used to work)

Unanswered
Japanese Chin posted this in #help-forum
Open in Discord
Japanese ChinOP
I use packages @react-barcode-scanner/components / @react-barcode-scanner/hooks (which I created) which in turn use @undecaf/barcode-detector-polyfill . That packages makes a dynamic import from https://cdn.jsdelivr.net.

After everything working for quite a while I receive the following error:

 ⨯ ./https:/cdn.jsdelivr.net/npm/@undecaf/zbar-wasm@0.9.16/dist/main.js:15:654
Module not found: Can't resolve 'module'


It was working and then I made changes to the @react-barcode-scanner packages, which I now think may have changed the @undecaf version(s). After updating the dependencies in my main app, things won't work when doing pnpm dev or pnpm build, and the error above happens.

next.lock directory appears to contain the files which are reported as not found.

I have cleared pnpm store, node_modules, lockfiles, etc. I have tried rolling various things back, pnpm linking, etc.

Any ideas?

1 Reply

Japanese ChinOP
I now see that the urlImport-ed file actually ends in import("module") and that this is likely the problem. I will more carefully try to walk the version back or look to solve this particular problem