Build crashes on building react typescript project:
https://github.com/lindskogen/parcel-v2-repro
I expect the code to be bundled.
yarn parcel build src/index.ts
๐จ Error: Got unexpected undefined
Error: Got unexpected undefined
at nullthrows (/Users/lindskogen/parcel/node_modules/nullthrows/nullthrows.js:7:15)
at TSModuleGraph.resolveImport (/Users/lindskogen/parcel/packages/transformers/typescript-types/src/TSModuleGra
ph.js:108:13)
at resolveImport (/Users/lindskogen/parcel/packages/transformers/typescript-types/src/TSModuleGraph.js:55:29)
at visitNode (/Users/lindskogen/parcel-repro/node_modules/typescript/lib/typescript.js:67595:23)
at Object.visitEachChild (/Users/lindskogen/parcel-repro/node_modules/typescript/lib/typescript.js:67761:57)
at visitEachChild (/Users/lindskogen/parcel/packages/transformers/typescript-types/src/TSModuleGraph.js:67:17)
at visitNode (/Users/lindskogen/parcel-repro/node_modules/typescript/lib/typescript.js:67595:23)
at Object.visitEachChild (/Users/lindskogen/parcel-repro/node_modules/typescript/lib/typescript.js:67899:108)
at TSModuleGraph.visitEachChild [as markUsed] (/Users/lindskogen/parcel/packages/transformers/typescript-types/
src/TSModuleGraph.js:72:10)
at TSModuleGraph.markUsed [as propagate] (/Users/lindskogen/parcel/packages/transformers/typescript-types/src/T
SModuleGraph.js:171:12)
Removing the "types" field from package.json makes it work
https://github.com/lindskogen/parcel-v2-repro
| Software | Version(s) |
| ---------------- | ---------- |
| Parcel | 2.0.0-alpha.2.1
| Node | v10.17.0
| npm/Yarn | 1.19.1
| Operating System | macOS Catalina (10.15.1)
Thanks so much for the detailed repro! Should be fixed by #3712.
@devongovett Thank you for the fix! I cloned you branch locally and tried it again. Now it worked in my repro but not in my real project.
Could this be an issue with yarn workspaces?
I have updated my repro-repo _(Try saying that five times fast!)_ with a yarn workspaces example that still have this issue!
Thanks I'll take a look.
@lindskogen I think this is a separate issue. We don't support extends in tsconfig yet. If you copy and paste the config from the outer tsconfig in your project into the inner one instead it works. I'll work on supporting extends in a separate PR.
Oh, I didn't know that. Thank you for your time and quick reply!
extends is implemented in #3728.
You're the man! Thanks!
Most helpful comment
Thanks so much for the detailed repro! Should be fixed by #3712.