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.

Failing resolving a module at runtime

See original GitHub issue

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

github_iconTop GitHub Comments

1reaction
vankopcommented, Mar 14, 2022

thanks. I found problem.

0reactions
indiketacommented, Mar 14, 2022

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

Read more comments on GitHub >

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

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