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

speeding up build on windows - Failed to parse file #2154

Open
JonCatmull opened this issue Nov 28, 2017 · 5 comments
Open

speeding up build on windows - Failed to parse file #2154

JonCatmull opened this issue Nov 28, 2017 · 5 comments

Comments

@JonCatmull
Copy link

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
Copy link
Author

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

@vyakymenko
Copy link
Contributor

vyakymenko commented Feb 26, 2018

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

@vyakymenko
Copy link
Contributor

@JonCatmull , still existing issue?

@ComFreek
Copy link

ComFreek commented Mar 3, 2018

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.

@JonCatmull
Copy link
Author

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

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

No branches or pull requests

3 participants