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.

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

github_iconTop GitHub Comments

3reactions
devongovettcommented, Oct 31, 2019

Thanks so much for the detailed repro! Should be fixed by #3712.

0reactions
lindskogencommented, Nov 3, 2019

You’re the man! Thanks!

Read more comments on GitHub >

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

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