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.

🐛 Not displaying or honoring Typescript errors

See original GitHub issue

Using a minimal typescript project, parcel will not display errors that typescript catches.

🎛 Configuration (.babelrc, package.json, cli command)

Babel is not used in the example I gave but could be easily put in.

🤔 Expected Behavior

parcel should display errors caught by typescript in two places.

  1. In the CLI
  2. On the web page, either as an overlay or in the console

Also, parcel should honor noEmitOnError in tsconfig.json and not output compiled code if an error is found when running parcel build

😯 Current Behavior

No errors are displayed and the project builds even when noEmitOnError is set to true

🔦 Context

I have been trying to integrate parcel with a medium size typescript project I have, however it swallows typescript errors.

💻 Code Sample

https://github.com/kaw2k/parcel-typescript-errors

🌍 Your Environment

Software Version(s)
Parcel v1.4.1
Node v8.2.1
npm/Yarn Yarn
Operating System OSX High Sierra

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:37
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

26reactions
Offirmocommented, Jan 5, 2019

Why closing this request?

Ignoring errors defeats the puprose of using TypeScript. Thus the advertised TypeScript “support” is misleading.

11reactions
nexussayscommented, Jul 18, 2019

If it helps anyone else, this is the workaround I came up with after reading through this issue and all the other ones related to Typescript support trying to find a solution.

Use the concurrently package (npm i -D concurrently) and then in package.json:

"scripts": {
   "dev": "concurrently --kill-others \"npm:compile:watch\" \"npm:dev:server\"",
   "dev:server": "parcel ./src/index.html --https --out-dir artifacts/obj",
   "compile:watch": "tsc -p . --noEmit --watch",
}

Then npm run dev will output something like:

01:20:35 - File change detected. Starting incremental compilation...
[compile:watch] 01:20:35 - Found 0 errors. Watching for file changes.
[dev:server] √  Built in 605ms.

01:20:55 - File change detected. Starting incremental compilation...
[dev:server] √  Built in 637ms.
[compile:watch] src/components/AppRoot.tsx(69,14): error TS2304: Cannot find name 'Counter'.
[compile:watch] 01:20:55 - Found 1 error. Watching for file changes.

It doesn’t fail the Parcel build, but I personally don’t care as it only takes a few hundred milliseconds.

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeScript errors are not being shown on screen on vs code
1 Answer 1 · Going to Settings (on Mac "Code" -> "Preferences" -> "Settings") · Searching for something like "Typescript validate" · In...
Read more >
[WFR] Building a project does not honor the tsconfig.json ...
I have a tsconfig.json in a project that's been on hold and inactive for a few weeks, and when starting it back up...
Read more >
Changelog - Cypress Documentation
Fixed a bug where projects using Node.js 16.17+ and 18.6+ with ES Modules and TypeScript were not working with Cypress. Fixes #22795, #23393,...
Read more >
Registration Errors - Office of the Registrar
To resolve this error, students must register only for courses taught fully online. Example: An online learner attempting to register for a main...
Read more >
MapView | API Reference | ArcGIS Maps SDK for JavaScript ...
goTo({ center: [-112, 38], zoom: 12 }); }) .catch(function(err) { // A rejected view indicates a fatal error making it unable to display....
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