TypeStrong / TypeStrong/ts-loader
Blocker runtime error if using webpack federation plugin
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 3.5k
- Forks
- 439
- Avg merge
- 17h 17m
- Merged PRs (30d)
- 2
Description
Expected Behaviour
ts-loader should work with webpack and the native plugin ModuleFederationPlugin.
Actual Behaviour
If ModuleFederationPlugin gets enabled a invalid bundle is generated and a runtime error breaks the loading of the source.
Error:
Uncaught Error: Shared module is not available for eager consumption
Steps to Reproduce the Problem
Create a simple project with webapack and ts-loader and ModuleFederationPlugin ( example bellow ).
Location of a Minimal Repository that Demonstrates the Issue.
If you comment the ts-loader config and uncomment babel it works just fine.
It also works if we remove ModuleFederationPlugin.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked minimal repository's webpack.config.js and reproduce the invalid bundle using ts-loader with ModuleFederationPlugin. Compare the ts-loader configuration with the working babel configuration, then verify that the generated bundle loads without the “Shared module is not available for eager consumption” runtime error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript, webpack
- Domain
- build-system, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100