TypeStrong / TypeStrong/ts-loader
Bundle failure when export default "satisfies" any generic type, in Typescript 4.9.1-beta
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 3.5k
- Forks
- 439
- Avg merge
- 17h 17m
- Merged PRs (30d)
- 2
Description
Expected Behaviour
Output file is bundled correctly.
Actual Behaviour
The output file index.js only contains the 2 lines of the compiled entry file without bundling anything.
(()=>{"use strict"
simpleWrap(mainComponent,void 0)})()
Steps to Reproduce the Problem
Import anything and use it in export default,
Then add "satisfies Readonly" or satisfies any other generic type at the end
import mainComponent from '@/mainComponent';
import simpleWrap from '@/simpleWrap';
export default simpleWrap(
mainComponent,
undefined,
) satisfies Readonly<unknown>;
This only happens when export default satisfies a generic type, "satisfies unknown" or "satisfies () => void" work correctly.
Dependencies:
"ts-loader": "^9.3.1",
"typescript": "^4.9.1-beta",
"webpack": "^5.74.0",
"webpack-bundle-analyzer": "^4.6.1",
"webpack-cli": "^4.10.0",
"webpack-dev-server": "^4.10.1",
Location of a Minimal Repository that Demonstrates the Issue.
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 by reproducing the issue with the listed ts-loader, TypeScript 4.9.1-beta, and webpack dependencies using the export-default example. Compare the generated index.js with the expected bundle and test the generic satisfies case against the working satisfies unknown case. Done means imported modules are bundled correctly for the generic satisfies expression.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript, webpack
- Domain
- build-system, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100