Repository navigation
BroccoliTypscriptCompiler error during ng serve #403
Copy link
Copy link
Closed
Labels
Description
Running ng serve and making a change to a file gives me the following error:
The Broccoli Plugin: [BroccoliTypeScriptCompiler] failed with:
Error: EEXIST: file already exists, link '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/Users/pascalprecht/projects/thoughtram/angular2-master-class-solutions/tmp/broccoli_type_script_compiler-cache_path-g6eAeTvI.tmp/src/client/app/contact-header/contact-header.js.map' -> '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/Users/pascalprecht/projects/thoughtram/angular2-master-class-solutions/tmp/broccoli_type_script_compiler-output_path-z1rCCzws.tmp/src/client/app/contact-header/contact-header.js.map'
at Error (native)
at Object.fs.linkSync (fs.js:918:18)
at BroccoliTypeScriptCompiler._outputFile (/Users/pascalprecht/projects/thoughtram/angular2-master-class-solutions/node_modules/angular-cli/lib/broccoli/broccoli-typescript.js:205:8)
at Object.writeFile (/Users/pascalprecht/projects/thoughtram/angular2-master-class-solutions/node_modules/angular-cli/lib/broccoli/broccoli-typescript.js:163:14)
at Object.writeFile (/Users/pascalprecht/projects/thoughtram/angular2-master-class-solutions/node_modules/typescript/lib/typescript.js:6515:14)
at writeEmittedFiles (/Users/pascalprecht/projects/thoughtram/angular2-master-class-solutions/node_modules/typescript/lib/typescript.js:32726:24)
at doEmit (/Users/pascalprecht/projects/thoughtram/angular2-master-class-solutions/node_modules/typescript/lib/typescript.js:32594:17)
at emitFile (/Users/pascalprecht/projects/thoughtram/angular2-master-class-solutions/node_modules/typescript/lib/typescript.js:39322:17)
at onSingleFileEmit (/Users/pascalprecht/projects/thoughtram/angular2-master-class-solutions/node_modules/typescript/lib/typescript.js:6483:13)
at Object.forEachExpectedEmitFile (/Users/pascalprecht/projects/thoughtram/angular2-master-class-solutions/node_modules/typescript/lib/typescript.js:6457:21)
The broccoli plugin was instantiated at:
at BroccoliTypeScriptCompiler.Plugin (/Users/pascalprecht/projects/thoughtram/angular2-master-class-solutions/node_modules/angular-cli/node_modules/broccoli-caching-writer/node_modules/broccoli-plugin/index.js:10:31)
at BroccoliTypeScriptCompiler.CachingWriter [as constructor] (/Users/pascalprecht/projects/thoughtram/angular2-master-class-solutions/node_modules/angular-cli/node_modules/broccoli-caching-writer/index.js:21:10)
at BroccoliTypeScriptCompiler (/Users/pascalprecht/projects/thoughtram/angular2-master-class-solutions/node_modules/angular-cli/lib/broccoli/broccoli-typescript.js:26:10)
at Angular2App.toTree.Angular2App._getTsTree (/Users/pascalprecht/projects/thoughtram/angular2-master-class-solutions/node_modules/angular-cli/lib/broccoli/angular2-app.js:249:16)
at Angular2App.toTree (/Users/pascalprecht/projects/thoughtram/angular2-master-class-solutions/node_modules/angular-cli/lib/broccoli/angular2-app.js:37:21)
at module.exports (/Users/pascalprecht/projects/thoughtram/angular2-master-class-solutions/angular-cli-build.js:14:14)
at Class.module.exports.Task.extend.setupBroccoliBuilder (/Users/pascalprecht/projects/thoughtram/angular2-master-class-solutions/node_modules/angular-cli/node_modules/angular-cli/lib/models/builder.js:55:19)
at Class.module.exports.Task.extend.init (/Users/pascalprecht/projects/thoughtram/angular2-master-class-solutions/node_modules/angular-cli/node_modules/angular-cli/lib/models/builder.js:89:10)
at new Class (/Users/pascalprecht/projects/thoughtram/angular2-master-class-solutions/node_modules/angular-cli/node_modules/angular-cli/node_modules/core-object/core-object.js:18:12)
at Class.module.exports.Task.extend.run (/Users/pascalprecht/projects/thoughtram/angular2-master-class-solutions/node_modules/angular-cli/node_modules/angular-cli/lib/tasks/serve.js:15:19)
This error does not occur when I kill the serve process and start it again.
Reactions are currently unavailable
Activity
0x-r4bbit commentedon Apr 7, 2016
I should add that this only appears when
ng servethrew a TS compiler error anyway.So when there's a TS error, and I fix it, I get the error mentioned above
jkuri commentedon Apr 7, 2016
Also for me. @hansl is aware of that issue.
jp5486 commentedon Apr 8, 2016
I am having the same issue except the error is still persisting after attempting to serve again
jp5486 commentedon Apr 8, 2016
`file changed app.ts
The Broccoli Plugin: [BroccoliTypeScriptCompiler] failed with:
Error: EEXIST: file already exists, link '/Users/JeremyP/Desktop/sleepdiary/tmp/broccoli_type_script_compiler-cache_path-v690MQVD.tmp/src/app/entry/entry.service.js.map' -> '/Users/JeremyP/Desktop/sleepdiary/tmp/broccoli_type_script_compiler-output_path-DvdvYPCa.tmp/src/app/entry/entry.service.js.map'
at Error (native)
at Object.fs.linkSync (fs.js:966:18)
at BroccoliTypeScriptCompiler._outputFile (/Users/JeremyP/Desktop/sleepdiary/node_modules/angular-cli/lib/broccoli/broccoli-typescript.js:205:8)
at Object.writeFile (/Users/JeremyP/Desktop/sleepdiary/node_modules/angular-cli/lib/broccoli/broccoli-typescript.js:163:14)
at Object.writeFile (/Users/JeremyP/Desktop/sleepdiary/node_modules/typescript/lib/typescript.js:6515:14)
at writeEmittedFiles (/Users/JeremyP/Desktop/sleepdiary/node_modules/typescript/lib/typescript.js:32726:24)
at doEmit (/Users/JeremyP/Desktop/sleepdiary/node_modules/typescript/lib/typescript.js:32594:17)
at emitFile (/Users/JeremyP/Desktop/sleepdiary/node_modules/typescript/lib/typescript.js:39322:17)
at onSingleFileEmit (/Users/JeremyP/Desktop/sleepdiary/node_modules/typescript/lib/typescript.js:6483:13)
at Object.forEachExpectedEmitFile (/Users/JeremyP/Desktop/sleepdiary/node_modules/typescript/lib/typescript.js:6457:21)
The broccoli plugin was instantiated at:
at BroccoliTypeScriptCompiler.Plugin (/Users/JeremyP/Desktop/sleepdiary/node_modules/broccoli-plugin/index.js:10:31)
at BroccoliTypeScriptCompiler.CachingWriter as constructor
at BroccoliTypeScriptCompiler (/Users/JeremyP/Desktop/sleepdiary/node_modules/angular-cli/lib/broccoli/broccoli-typescript.js:25:35)
at Angular2App.toTree.Angular2App._getTsTree (/Users/JeremyP/Desktop/sleepdiary/node_modules/angular-cli/lib/broccoli/angular2-app.js:249:16)
at Angular2App.toTree (/Users/JeremyP/Desktop/sleepdiary/node_modules/angular-cli/lib/broccoli/angular2-app.js:37:21)
at module.exports (/Users/JeremyP/Desktop/sleepdiary/angular-cli-build.js:9:14)
at Class.module.exports.Task.extend.setupBroccoliBuilder (/Users/JeremyP/Desktop/sleepdiary/node_modules/angular-cli/lib/models/builder.js:55:19)
at Class.module.exports.Task.extend.init (/Users/JeremyP/Desktop/sleepdiary/node_modules/angular-cli/lib/models/builder.js:89:10)
at new Class (/Users/JeremyP/Desktop/sleepdiary/node_modules/core-object/core-object.js:18:12)
at Class.module.exports.Task.extend.run (/Users/JeremyP/Desktop/sleepdiary/node_modules/angular-cli/lib/tasks/serve.js:15:19)
`
vt5491 commentedon Apr 8, 2016
I'm getting the same behavior upon fixing a bug, except I get:
Error: Trying to add a new entry to an already existing one:
I have an open stackoverflow question with more details. Resetting the server does work for me.
Here is the full error text:
A problem deleting old files like this prior ticket?
vt5491 commentedon Apr 8, 2016
I upgraded to watchman as recommended under the ember-cli web site to see if this would fix the problem. Unfortunately, it did not.
So the problem happens with NodeWatcher and Watchman.
I also tried the emacs lockfile fixes as recommended under the ember-cli site, but no effect here either.
I am running Linux mint 17.3.
The problem is also reproducible for me under windows 10.
vt5491 commentedon Apr 8, 2016
Since this problem was really bugging me -- to the point where I just couldn't work with angular-cli anymore, I just looked at the stack trace and basically zapped the code to ignore these problems. I've been using it for several hours now, and everything seems to work fine. I would think a real fix would be about figuring out why it's trying to use duplicate files, but here's what I did anyway:
edit module
node_modules/angular-cli/lib/broccoli/broccoli-typescript.jsedit method
_addNewFileEntrylike so (altered code marked by my initials 'vt'):_outputFile:A full output log now looks like:
Note the
Build Successfulmessage at the end, instead of having to hit Ctrl-C and cycle the server. Once you get the condition, you always seem to get it e.g it seems to keep using the same tmp files over and over (?)jkuri commentedon Apr 8, 2016
@vt5491 thanks for this, but IMO this is complex enough to let @hansl do the work. He rewrote the whole
broccoli-typescript.jsabout a week ago and knows how things are in compiler. Since there's a really lousy docs about TS compiler or even not existent please wait, I think the patch is coming soon.vt5491 commentedon Apr 8, 2016
That's good news. Looking forward to the official patch.
jkuri commentedon Apr 11, 2016
This has been resolved with #416.
fixing the build by downgrading angular-cli to v0.0.30
7 remaining items
alonp99 commentedon Jul 15, 2016
+1 with cli beta.9 & angular2 rc.4
lfvepclr commentedon Jul 17, 2016
+1 with cli beta.9 & angular2 rc.4
Crypt0Graphic commentedon Aug 2, 2016
I had same weird problem with Angular-cli 1.0.0-beta.10 & Angular2 RC4
jkuri commentedon Aug 2, 2016
Does that happens when you delete some of the source file?
sirajc commentedon Aug 2, 2016
Check if this is repro in .11 version
Crypt0Graphic commentedon Aug 3, 2016
I found my problem. (It was not same problem as in this topic. Sorry.)
When i add a parameter to constructor in my component (member.component.ts) i didn't update test file (member.component.spec.ts) manually. And i got error from tmp folder like below:
.../tmp/broccoli_type_script_compiler-input_base_path-gSIkus6k.tmp/0/src/app/mng/mng.component.spec.ts (10, 21): Supplied parameters do not match any signature of call target.
When i deleted/commented describe section in member.component.spec.ts, it was builded normally and error has gone.
So if you see an error about spec.ts and parameters, think about test file. Weird one is error does not tell about exact file.
chanducky commentedon Aug 6, 2016
I am using following versions
+-- angular-cli@1.0.0-beta.10
| +-- ember-cli@2.5.0
| | +-- npm@2.14.21
| | |
-- graceful-fs@4.1.3 | |-- yam@0.0.18| |
-- fs-extra@0.16.5 | |-- graceful-fs@3.0.8| +-- fs-extra@0.30.0
| |
-- graceful-fs@4.1.4 |-- npm@3.10.2|
-- graceful-fs@4.1.4-- karma@0.13.22`-- graceful-fs@4.1.5
My app was working fine once I close the cmd and start again, I am getting below errors :
`
C:\Users\Chandra\Desktop\angi\a2todos>ng serve
(node:1940) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.
Livereload server on http://localhost:49152
Serving on http://localhost:4200/
The Broccoli Plugin: [BroccoliTypeScriptCompiler] failed with:
Error: Typescript found the following errors:
C:/Users/Chandra/Desktop/angi/a2todos/tmp/broccoli_type_script_compiler-input_base_path-WD7fUJ9p.tmp/0/src/app/todos/todos.component.spec.ts (10, 21): Supplied parameters do not match any signature of call target.
at BroccoliTypeScriptCompiler._doIncrementalBuild (C:\Users\Chandra\Desktop\angi\a2todos\node_modules\angular-cli\lib\broccoli\broccoli-typescript.js:120:19)
at BroccoliTypeScriptCompiler.build (C:\Users\Chandra\Desktop\angi\a2todos\node_modules\angular-cli\lib\broccoli\broccoli-typescript.js:43:10)
at C:\Users\Chandra\Desktop\angi\a2todos\node_modules\angular-cli\node_modules\broccoli-caching-writer\index.js:152:21
at lib$rsvp$$internal$$tryCatch (C:\Users\Chandra\Desktop\angi\a2todos\node_modules\angular-cli\node_modules\rsvp\dist\rsvp.js:1036:16)
at lib$rsvp$$internal$$invokeCallback (C:\Users\Chandra\Desktop\angi\a2todos\node_modules\angular-cli\node_modules\rsvp\dist\rsvp.js:1048:17)
at lib$rsvp$$internal$$publish (C:\Users\Chandra\Desktop\angi\a2todos\node_modules\angular-cli\node_modules\rsvp\dist\rsvp.js:1019:11)
at lib$rsvp$asap$$flush (C:\Users\Chandra\Desktop\angi\a2todos\node_modules\angular-cli\node_modules\rsvp\dist\rsvp.js:1198:9)
at _combinedTickCallback (internal/process/next_tick.js:67:7)
at process._tickCallback (internal/process/next_tick.js:98:9)
The broccoli plugin was instantiated at:
at BroccoliTypeScriptCompiler.Plugin (C:\Users\Chandra\Desktop\angi\a2todos\node_modules\angular-cli\node_modules\broccoli-plugin\index.js:10:31)
at BroccoliTypeScriptCompiler.CachingWriter as constructor
at BroccoliTypeScriptCompiler (C:\Users\Chandra\Desktop\angi\a2todos\node_modules\angular-cli\lib\broccoli\broccoli-typescript.js:27:5)
at Angular2App._getTsTree (C:\Users\Chandra\Desktop\angi\a2todos\node_modules\angular-cli\lib\broccoli\angular2-app.js:331:18)
at Angular2App._buildTree (C:\Users\Chandra\Desktop\angi\a2todos\node_modules\angular-cli\lib\broccoli\angular2-app.js:124:23)
at new Angular2App (C:\Users\Chandra\Desktop\angi\a2todos\node_modules\angular-cli\lib\broccoli\angular2-app.js:53:23)
at module.exports (C:\Users\Chandra\Desktop\angi\a2todos\angular-cli-build.js:10:10)
at Class.module.exports.Task.extend.setupBroccoliBuilder (C:\Users\Chandra\Desktop\angi\a2todos\node_modules\angular-cli\node_modules\angular-cli\lib\models\builder.js:55:19)
at Class.module.exports.Task.extend.init (C:\Users\Chandra\Desktop\angi\a2todos\node_modules\angular-cli\node_modules\angular-cli\lib\models\builder.js:89:10)
at new Class (C:\Users\Chandra\Desktop\angi\a2todos\node_modules\angular-cli\node_modules\core-object\core-object.js:18:12)
at Class.module.exports.Task.extend.run (C:\Users\Chandra\Desktop\angi\a2todos\node_modules\angular-cli\node_modules\angular-cli\lib\tasks\serve.js:15:19)
at C:\Users\Chandra\Desktop\angi\a2todos\node_modules\angular-cli\node_modules\angular-cli\lib\commands\serve.js:64:24
at lib$rsvp$$internal$$tryCatch (C:\Users\Chandra\Desktop\angi\a2todos\node_modules\angular-cli\node_modules\rsvp\dist\rsvp.js:1036:16)
at lib$rsvp$$internal$$invokeCallback (C:\Users\Chandra\Desktop\angi\a2todos\node_modules\angular-cli\node_modules\rsvp\dist\rsvp.js:1048:17)
at lib$rsvp$$internal$$publish (C:\Users\Chandra\Desktop\angi\a2todos\node_modules\angular-cli\node_modules\rsvp\dist\rsvp.js:1019:11)
at lib$rsvp$asap$$flush (C:\Users\Chandra\Desktop\angi\a2todos\node_modules\angular-cli\node_modules\rsvp\dist\rsvp.js:1198:9)
`
radonirinamaminiaina commentedon Aug 10, 2016
If you comment some code in the
todos.component.spec.ts, this error will disappear.Try to do it:
I know that I will need it for unit test, and I don't know how to solve it.
It's not a good solution.
+1
michaelcm commentedon Aug 11, 2016
Running into a similar issue with all spec files generated with angular-cli 1.0.0-beta.10 & Angular2 RC4 (or 5). For me 'ng serve' works fine, but 'ng build -prod' does not, and fails with:
In the code, the keywords describe, it and expect are all underlined with message "Cannot find name 'describe'" for example.
Renaming or removing the spec files fixes it, but it would be nice to be able to try out unit tests too. Any ideas would be appreciated. Thanks!
victorazevedo commentedon Dec 23, 2016
same problem on WINDOWS...RUN git bash as ADMINISTRATOR than problem solved
LintonBlack commentedon Jan 3, 2017
Great ! thanks @victorazevedo
"RUN git bash as ADMINISTRATOR than problem solved"
dok53 commentedon Aug 17, 2017
@TheOriginalJosh worked like a treat. Thanks :)
angular-automatic-lock-bot commentedon Sep 7, 2019
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.