Skip to content
This repository has been archived by the owner on Jan 26, 2019. It is now read-only.

Verbose output during build? #334

Closed
TazmanianD opened this issue Jun 1, 2018 · 4 comments
Closed

Verbose output during build? #334

TazmanianD opened this issue Jun 1, 2018 · 4 comments

Comments

@TazmanianD
Copy link

Is this a bug report?

Maybe?

Can you also reproduce the problem with npm 4.x?

Yes, we're using npm 4.2.0.

Which terms did you search for in User Guide?

"verbose", "output", "message"

Environment

Node 7.9.0, Npm 4.2.0, react-script-ts 2.16.0, TypeScript 7.9.1

Windows 7

Steps to Reproduce

I have just upgraded from react-script-ts 2.8.0 to 2.16.0 and suddenly we're getting massive amounts of verbose output or messages during a build. It appears to be verbose or debug output from the compiler describing how it is resolving resolving dependencies. Is this expected and if so, is there a way to disable it? In our case, this is producing 15,000 lines of output content which does not appear useful. The only change I made was upgrading the version of react-script-ts (including creating an simple tslint.json and a tsconfig.prod.json).

The build does complete successfully and ends with the "Compiled successfully." message along with the stats about the output. Previously, that info was the only thing output during the build.

Here is a snippet of the top of our output.

> [email protected] build C:\Work\Journeys\radar\client
> react-scripts-ts build

Creating an optimized production build...
Starting type checking and linting service...
Using �[1m1 worker�[22m with �[1m2048MB�[22m memory limit
ts-loader: Using [email protected] and C:\Work\Journeys\radar\client\tsconfig.prod.json
======== Resolving type reference directive 'body-parser', containing file 'C:/Work/Journeys/radar/client/__inferred type names__.ts', root directory 'C:/Work/Journeys/radar/node_modules/@types,C:/Work/Journeys/radar/client/node_modules/@types'. ========
Resolving with primary search path 'C:/Work/Journeys/radar/node_modules/@types, C:/Work/Journeys/radar/client/node_modules/@types'.
'package.json' does not have a 'typings' field.
'package.json' does not have a 'types' field.
'package.json' has 'main' field '' that references 'C:/Work/Journeys/radar/node_modules/@types/body-parser'.
Found 'package.json' at 'C:/Work/Journeys/radar/node_modules/@types/body-parser/package.json'. Package ID is '@types/body-parser/[email protected]'.
'package.json' does not have a 'typings' field.
'package.json' does not have a 'types' field.
File 'C:/Work/Journeys/radar/node_modules/@types/body-parser/index.d.ts' exist - use it as a name resolution result.
Resolving real path for 'C:/Work/Journeys/radar/node_modules/@types/body-parser/index.d.ts', result 'C:/Work/Journeys/radar/node_modules/@types/body-parser/index.d.ts'.
======== Type reference directive 'body-parser' was successfully resolved to 'C:/Work/Journeys/radar/node_modules/@types/body-parser/index.d.ts', primary: true. ========
======== Resolving type reference directive 'chai', containing file 'C:/Work/Journeys/radar/client/__inferred type names__.ts', root directory 'C:/Work/Journeys/radar/node_modules/@types,C:/Work/Journeys/radar/client/node_modules/@types'. ========
Resolving with primary search path 'C:/Work/Journeys/radar/node_modules/@types, C:/Work/Journeys/radar/client/node_modules/@types'.
'package.json' does not have a 'typings' field.
'package.json' does not have a 'types' field.
'package.json' has 'main' field '' that references 'C:/Work/Journeys/radar/node_modules/@types/chai'.
Found 'package.json' at 'C:/Work/Journeys/radar/node_modules/@types/chai/package.json'. Package ID is '@types/chai/[email protected]'.
'package.json' does not have a 'typings' field.
'package.json' does not have a 'types' field.
File 'C:/Work/Journeys/radar/node_modules/@types/chai/index.d.ts' exist - use it as a name resolution result.
Resolving real path for 'C:/Work/Journeys/radar/node_modules/@types/chai/index.d.ts', result 'C:/Work/Journeys/radar/node_modules/@types/chai/index.d.ts'.
======== Type reference directive 'chai' was successfully resolved to 'C:/Work/Journeys/radar/node_modules/@types/chai/index.d.ts', primary: true. ========
...

Expected Behavior

No massive amounts of output.

Actual Behavior

Massive amounts of output.

@TazmanianD
Copy link
Author

Well, nevermind. I figured out that output was coming from the tsc option --traceResolution. I then found out that we had the set to true in our tsconfig.json for some reason. It must have been put there by whatever tool we used to bootstrap the initial version of that file. What I don't understand is why I've never seen this output before in either our server or client builds. react-scripts-ts obviously did something to fix this but that's a good thing.

@Roustalski
Copy link

Roustalski commented Aug 29, 2018

I don't suppose you, or anyone else knows how to get verbose output from the react-scripts?

I need more output to figure out what's going on.
IHttpClient is, in fact, an export of http-clients, and not a default export. the location-list/services.ts file imports IHttpClient using braces. i.e. import { IHttpClient } from ...

yarn run v1.9.4
$ react-scripts-ts build
Creating an optimized production build...
Starting type checking and linting service...
Using 1 worker with 2048MB memory limit
ts-loader: Using [email protected] and /Users/.../tsconfig.prod.json
Failed to compile.

./src/features/location-list/services.ts
64:61-72 '../../util/http-clients' does not contain an export named 'IHttpClient'.


error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

@TazmanianD
Copy link
Author

Did you try the --traceResolution option in tsconfig.json like I mentioned above?

@Roustalski
Copy link

Roustalski commented Aug 29, 2018

I did, but there was nothing wrong with typescript's resolution. In fact, tsc compiles the app correctly with no errors or warnings.

I believe I found the issue and a possible solution: TypeStrong/ts-loader#653 (comment)

Oh, and I had to eject and modify the webpack message parser to get more output, which was equally unhelpful.

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

No branches or pull requests

2 participants