angular-seed icon indicating copy to clipboard operation
angular-seed copied to clipboard

speeding up build on windows - Failed to parse file

Open JonCatmull opened this issue 8 years ago • 5 comments

Thanks in advance for any help.

I'm submitting a ... (check one with "x")

[x] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here, instead see use [gitter](https://gitter.im/mgechev/angular2-seed) or [stackoverflow](https://stackoverflow.com/questions/tagged/angular2)

Current behavior Running the below command as per instructions in speeding up build on windows wiki page tsc --project tsconfig.json

throws error: error TS5014: Failed to parse file 'tsconfig.json/tsconfig.json': Unexpected token u in JSON at position 0.

Expected behavior compile tools to js files

Minimal reproduction of the problem with instructions tsc --project tsconfig.json

Please tell us about your environment: OS: Windows 10 IDE: VSCode v1.17.2 NPM v4.0.2 node v 6.9.1

  • Angular Seed Version: 234a5fed2bc74ec6dceb32b6ddf09dcc504b4083

  • Node: node --version = 6.9.1

JonCatmull avatar Nov 28 '17 11:11 JonCatmull

The reason I'm trying to speed up the build is my build time has gone up massively and I'm not sure why. It used to be a few seconds and now it is consistently 1.6 mins.

Latest compile:

[10:54:27] Starting 'build.dev'...
[10:54:27] Starting 'initialize'...
[10:54:27] Starting 'noop'...
[10:54:27] Finished 'noop' after 105 μs
[10:54:27] Finished 'initialize' after 901 μs
[10:54:27] Starting 'clean.once'...
[10:54:27] Skipping clean on rebuild
[10:54:27] Finished 'clean.once' after 198 μs
[10:54:27] Starting 'build.assets.dev'...
[10:54:27] Finished 'build.assets.dev' after 157 μs
[10:54:27] Starting 'build.fonts'...
[10:54:27] Finished 'build.fonts' after 18 ms
[10:54:27] Starting 'build.html_css'...
[10:54:28] Finished 'build.html_css' after 1.01 s
[10:54:28] Starting 'build.js.dev'...
[10:56:03] Finished 'build.js.dev' after 1.57 min
[10:56:03] Starting 'build.index.dev'...
[10:56:03] gulp-inject 3 files into index.html.
[10:56:03] gulp-inject 5 files into index.html.
[10:56:03] gulp-inject 6 files into index.html.
[10:56:03] Finished 'build.index.dev' after 68 ms
[10:56:03] Starting 'sw.manifest.static'...
[10:56:03] Finished 'sw.manifest.static' after 445 ms
[10:56:03] Finished 'build.dev' after 1.6 min
[BS] Reloading Browsers...

JonCatmull avatar Nov 28 '17 11:11 JonCatmull

Hello @JonCatmull , please install TypeScript npm install typescript -g and try again.

vyakymenko avatar Feb 26 '18 05:02 vyakymenko

@JonCatmull , still existing issue?

vyakymenko avatar Mar 02 '18 21:03 vyakymenko

I once had the same suspicious "Failed to parse file..." error after having run tsc (without --project tsconfig.json if I remember correctly). The solution was to delete every .js and .js.map files generated by that tsc, and to always use the npm run build.dev/prod build commands instead of tsc in this seed. But beware, only delete .js files for which there exist corresponding .ts files, i.e. there are still some raw JS-only scripts in this seed.

Somehow the tsconfig.json in this seed interferes with the remaining build process.

ComFreek avatar Mar 03 '18 08:03 ComFreek

Apologies I will test try these 2 commands today and let you know

JonCatmull avatar Mar 05 '18 08:03 JonCatmull