Parcel v2 - Types field in package.json crash
See original GitHub issue🐛 bug report
Build crashes on building react typescript project:
🎛 Configuration (.babelrc, package.json, cli command)
https://github.com/lindskogen/parcel-v2-repro
🤔 Expected Behavior
I expect the code to be bundled.
😯 Current Behavior
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)
💁 Possible Solution
Removing the "types"
field from package.json makes it work
💻 Code Sample
https://github.com/lindskogen/parcel-v2-repro
🌍 Your Environment
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) |
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Migration - Parcel
The first thing to note when upgrading from Parcel 1 to Parcel 2 is that the npm package name has changed from parcel-bundler...
Read more >Parcel showing ENOENT: no such file or directory error when I ...
It is very weird because in the error, there is supposed to be a file called dist/index.html.9424.5 , which really does not exist...
Read more >Package management basics - Learn web development | MDN
Go into your parcel-experiment directory and you should now find you've got a package.json file. Open it up and it should look something ......
Read more >parcel-transformer-svelte: Docs & Reviews | Openbase
You can change Svelte options though a .svelterc , svelte.config.js file or svelte field in package.json . For documentation on which options you...
Read more >JSONObject - Android Developers
Creates a new JSONObject with name/value mappings from the JSON string. ... Otherwise if the object is from a java package, returns the...
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 Free
Top 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
Thanks so much for the detailed repro! Should be fixed by #3712.
You’re the man! Thanks!