Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errors emitted by react-scripts build don't include any trace after upgrading to 5.0.0 #12043

Open
corymharper opened this issue Feb 10, 2022 · 3 comments

Comments

@corymharper
Copy link

I'm not sure if this is a bug or intended so I've marked it as a question for now...

I am upgrading an application from 4.0.3 to 5.0.0, one thing we noticed immediately however, is that build errors no longer include any kind of file trace with them, here's an example:

4.0.3:

/src/components/app.tsx
TypeScript error in /src/components/app.tsx(22,2):
'faPaperPlane' is declared but its value is never read.  TS6133

    20 | import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
    21 | import {
  > 22 | 	faPaperPlane,
       | 	^
    23 | 	faHandPointRight,
    24 | 	faLocationCircle,
    25 | 	faKey,

5.0.0

TS6133: 'faPaperPlane' is declared but its value is never read.
    20 | import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
    21 | import {
  > 22 | 	faPaperPlane,
       | 	^^^^^^^^^^^^
    23 | 	faHandPointRight,
    24 | 	faLocationCircle,
    25 | 	faKey,

The former is a lot more convenient to debug than the latter, and I'm not sure what about upgrading has caused the error to be less verbose, but is there something I'm missing, or a change I need to make since upgrading?

@slowWriting
Copy link

For me it looks like this:

ERROR in src/library/components/controls/search/SearchBox/SearchBox.tsx:2:1
TS6133: 'React' is declared but its value is never read.
   1 | import { Paper, Typography } from '@mui/material';
 > 2 | import * as React from 'react';
     | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   3 | import {
   4 |         InputWithButton,
   5 |         InputWithButtonProps,

I have no trace when it is first line:

 ERROR in src/library/components/controls/form/ControlledAutocomplete.tsx
 TS6133: 'React' is declared but its value is never read.

which version of typescript do you have?

@corymharper
Copy link
Author

For me it looks like this:

ERROR in src/library/components/controls/search/SearchBox/SearchBox.tsx:2:1
TS6133: 'React' is declared but its value is never read.
   1 | import { Paper, Typography } from '@mui/material';
 > 2 | import * as React from 'react';
     | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   3 | import {
   4 |         InputWithButton,
   5 |         InputWithButtonProps,

I have no trace when it is first line:

 ERROR in src/library/components/controls/form/ControlledAutocomplete.tsx
 TS6133: 'React' is declared but its value is never read.

which version of typescript do you have?

We are currently on 4.3.5.

@corymharper
Copy link
Author

I wanted to try from a blank project and got the same results, steps I followed:

  1. npx create-react-app my-app --template typescript
  2. Purposely wrote a simple error into the code: const test: number = null;
  3. npm run build
  4. Resulting error:
TS2322: Type 'null' is not assignable to type 'number'.
    4 |
    5 | function App() {
  > 6 |   const test: number = null;
      |         ^^^^
    7 |   console.log(test);
    8 |
    9 |   return (
  1. npm install [email protected]
  2. npm run build
  3. Resulting error:
/my-app/src/App.tsx
TypeScript error in /my-app/src/App.tsx(6,9):
Type 'null' is not assignable to type 'number'.  TS2322

    4 | 
    5 | function App() {
  > 6 |   const test: number = null;
      |         ^
    7 |   console.log(test);
    8 | 
    9 |   return (

The Typescript version in the project was 4.5.5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants