Failing resolving a module at runtime
See original GitHub issueBug report
What is the current behavior? Webpack compilation finishes without any error nor warning. At runtime an error is thrown while importing a module through a dynamic import.
“User-space” code router.js:259
:
pantalla = await import(
/* webpackChunkName: "generales" */
/* webpackMode: "lazy-once" */
`pantallas/generales/${idPantalla}.js`);
The following error is thrown:
router.js:368 TypeError: __webpack_require__.t is not a function
at |chunkName: generales|groupOptions: {}|namespace object:20:1
at async cargarPantalla (router.js:259:1)
This is the webpack-generated function causing the error:
function webpackAsyncContext(req) {
return webpackAsyncContextResolve(req).then(id => {
return __webpack_require__.t(id, fakeMap[id] | 16);
});
}
t
does not exist into __webpack_require__
.
A needed function is deleted while compiling/optimizing or mangling is not working properly, i don’t know.
What is the expected behavior? The function should exist, this is an error into webpack module resolution code. No clues or workarounds.
Other relevant information: webpack version: 5.70.0 Node.js version: 16.14 Operating System: Fedora 35 Additional tools: –
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Common TypeScript module problems and how to solve them
Enabling the compiler module resolution tracing in TypeScript can provide insight in diagnosing and solving problems.
Read more >Documentation - Module Resolution - TypeScript
Module resolution is the process the compiler uses to figure out what an import refers to. Consider an import statement like import {...
Read more >Webpack runtime conditional module resolution - Stack Overflow
The way I'm thinking of doing this is by building a resolve map, assuming I can chain path custom aliases, and Webpack tries...
Read more >Resolve "Unable to import module" errors from Python ... - AWS
I receive an "Unable to import module" error when I try to run my AWS Lambda code in Python. How do I resolve...
Read more >Failed to resolve module org.mule ... - MuleSoft Help Center
Basically there are 2 errors that appear under Problems tab in the IDE version ( Anypoint Studio 7.2.3 and Runtime version was 4.1.3...
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
thanks. I found problem.
The issue is: When a module exports nothing inside a dynamic import chunk, loading another module inside the chunk will make entire loading fail.
See this repo: https://github.com/indiketa/webpack5-dynamic-import-issue.git