-
Notifications
You must be signed in to change notification settings - Fork 12k
"Channel Closed" on ng serve rebuild with v1.5.0 #8331
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
Comments
Same here, after the second time I save a file. Start command
Versions
Error Message
|
Also seeing this exact behavior. |
Same issue here on win machine with medium large project. It works for some edits but then this error occurs. Sometimes immediately sometimes it takes some more rebuilds but it always end like this. |
Same problem !! |
same problem. can't able to work |
Update: on the same machine, switching to a fresh new node 8.9.0 64bit installation solved the issue for me! |
Unfortunately I can't update to node 64bit, but did update from 8.1.3 to 9.0.0 (ARMv7) and still have that issue. |
Also, I use: https://yadi.sk/d/PISF7IxL3PX6w2 |
This issue happens when any changes made to the external file like |
Same problem. I update Node a 8.9.1 - 32 bits and still have that problem. |
problem solved by moving to node v9.1. |
In v9.1. 32 bit. on second compile there comes no error however the server get stopped. |
My solution was to downgrade back to cli v1.4 |
Thanks CramericalIndustries it worked 👍 |
I moved my project over to my laptop that had node version 6.11.3 and I stopped getting the errors. I also tried upgrading my version to 8.9.1 and 9.1, but I didn't have any luck getting it to work. |
I think #8306 might have solved this. Can you please try |
@filipesilva is there a guide of how to install the beta releases? I tried doing |
gooood it's work after do this updats :
|
still getting the same error with cli 1.6.0-beta.0, Ubuntu 16.04 ERROR in Error [ERR_IPC_CHANNEL_CLOSED]: channel closed
at ChildProcess.target.send (internal/child_process.js:588:16)
at AngularCompilerPlugin._updateForkedTypeChecker (/home/sand/Storage/sand/Local/WebstormProjects/Angular/smartscale-refactor/node_modules/@ngtools/webpack/src/angular_compiler_plugin.js:360:34)
at Promise.resolve.then (/home/sand/Storage/sand/Local/WebstormProjects/Angular/smartscale-refactor/node_modules/@ngtools/webpack/src/angular_compiler_plugin.js:208:22)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)
webpack: Failed to compile.
ng -v
Angular CLI: 1.6.0-beta.0
Node: 8.9.1
OS: linux x64
Angular: 5.0.1
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, platform-server, router
... service-worker
@angular/cdk: 5.0.0-rc0
@angular/cli: 1.6.0-beta.0
@angular/flex-layout: 2.0.0-beta.10-4905443
@angular/material: 5.0.0-rc0
@angular-devkit/build-optimizer: 0.0.32
@angular-devkit/core: 0.0.20
@angular-devkit/schematics: 0.0.35
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 1.9.0-beta.0
@schematics/angular: 0.1.2
typescript: 2.6.1
webpack: 3.8.1
UPDATE: this error is not occurring in node 9.2 but there is another error I think it related to this issue:<--- Last few GCs --->
[14909:0x3907ec0] 1660022 ms: Mark-sweep 1361.7 (1456.4) -> 1361.7 (1456.9) MB, 1192.7 / 0.0 ms allocation failure GC in old space requested
[14909:0x3907ec0] 1661622 ms: Mark-sweep 1361.7 (1456.9) -> 1361.7 (1421.9) MB, 1599.5 / 0.0 ms last resort GC in old space requested
[14909:0x3907ec0] 1662580 ms: Mark-sweep 1361.7 (1421.9) -> 1361.7 (1421.9) MB, 957.9 / 0.0 ms last resort GC in old space requested
<--- JS stacktrace --->
==== JS stack trace =========================================
Security context: 0x3361a08a5749 <JSObject>
1: getNodeLinks(aka getNodeLinks) [/home/sand/Storage/sand/Local/WebstormProjects/Angular/smartscale-refactor/node_modules/typescript/lib/typescript.js:~24230] [pc=0x159b3f222545](this=0x368bc03822d1 <undefined>,node=0x28448a91ab21 <SourceFileObject map = 0x2bd6b88ffe51>)
2: checkSourceFileWorker(aka checkSourceFileWorker) [/home/sand/Storage/sand/Local/WebstormProjects/Angular/smartscal...
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
1: node::Abort() [/home/sand/.nvm/versions/node/v9.2.0/bin/node]
2: 0x11e177c [/home/sand/.nvm/versions/node/v9.2.0/bin/node]
3: v8::Utils::ReportOOMFailure(char const*, bool) [/home/sand/.nvm/versions/node/v9.2.0/bin/node]
4: v8::internal::V8::FatalProcessOutOfMemory(char const*, bool) [/home/sand/.nvm/versions/node/v9.2.0/bin/node]
5: v8::internal::Factory::NewFixedArray(int, v8::internal::PretenureFlag) [/home/sand/.nvm/versions/node/v9.2.0/bin/node]
6: v8::internal::HashTable<v8::internal::SeededNumberDictionary, v8::internal::SeededNumberDictionaryShape>::NewInternal(v8::internal::Isolate*, int, v8::internal::PretenureFlag) [/home/sand/.nvm/versions/node/v9.2.0/bin/node]
7: v8::internal::HashTable<v8::internal::SeededNumberDictionary, v8::internal::SeededNumberDictionaryShape>::New(v8::internal::Isolate*, int, v8::internal::PretenureFlag, v8::internal::MinimumCapacity) [/home/sand/.nvm/versions/node/v9.2.0/bin/node]
8: 0xde7508 [/home/sand/.nvm/versions/node/v9.2.0/bin/node]
9: 0xde7752 [/home/sand/.nvm/versions/node/v9.2.0/bin/node]
10: v8::internal::JSObject::NormalizeElements(v8::internal::Handle<v8::internal::JSObject>) [/home/sand/.nvm/versions/node/v9.2.0/bin/node]
11: 0xde83ce [/home/sand/.nvm/versions/node/v9.2.0/bin/node]
12: v8::internal::JSObject::AddDataElement(v8::internal::Handle<v8::internal::JSObject>, unsigned int, v8::internal::Handle<v8::internal::Object>, v8::internal::PropertyAttributes, v8::internal::Object::ShouldThrow) [/home/sand/.nvm/versions/node/v9.2.0/bin/node]
13: v8::internal::Object::AddDataProperty(v8::internal::LookupIterator*, v8::internal::Handle<v8::internal::Object>, v8::internal::PropertyAttributes, v8::internal::Object::ShouldThrow, v8::internal::Object::StoreFromKeyed) [/home/sand/.nvm/versions/node/v9.2.0/bin/node]
14: v8::internal::Object::SetProperty(v8::internal::LookupIterator*, v8::internal::Handle<v8::internal::Object>, v8::internal::LanguageMode, v8::internal::Object::StoreFromKeyed) [/home/sand/.nvm/versions/node/v9.2.0/bin/node]
15: v8::internal::Runtime_SetProperty(int, v8::internal::Object**, v8::internal::Isolate*) [/home/sand/.nvm/versions/node/v9.2.0/bin/node]
16: 0x159b3e1842fd
|
I guess you should downgrade cli until they are fixed |
Hi all, it looks like #8306 did not solve this problem. Let me tell you a bit about what's happening. For rebuilds, we spawn a separate process that runs TypeScript type-checking separately. This speeds up rebuilds. When you get a I'm looking for solutions on how to address this. I don't think trying to respawn the process is the right solution, because it might just be dying over and over again on your system. Instead I'm going to make compilation fallback to not using a separate process once the forked one dies. This will make rebuilds slower but at least you won't have to restart I'd still like to identify why the forked process dies. On my machine this doesn't happen. I don't think it happens on most projects since 1.5 has been out for a while but there haven't been that many reports. Things that affect most users get a lot more comments than in the first hours of breaking than this got in 24 days. Has anyone seen a pattern to it? If you notice it happening only on some cases please let me know. #8331 (comment) mentions that it happens only on interfaces/animations, did others see this pattern? |
This PR will prevent the main thread for exiting when the forked type checker exists unexpectedly. A warning will be logged on the console when this happens: ``` WARNING in AngularCompilerPlugin: Forked Type Checker exited unexpectedly. Falling back to typechecking on main thread. ``` Fix angular#8331
With #8646 you will get a warning instead, and |
@filipesilva thank you. Did you try to reproduce the issue on your machine with node.js 32bit or 64bit? For me it looks like most people who do have that problem were using the 32bit node.js version. |
My machine is Windows 10, node 8.9.1 64bits. |
@filipesilva Thanks for your reply. I have not mention that this often happens on my machine when I use |
I'm using |
Do you have any locally linked folders / npm packages? |
Let's keep this open as we don't know the source of the error yet. |
If someone has time, you can try changing the code directly to see if an error is shown. Open
This way, next time it crashes, there should be an error logged. If you put the error here that might help us pinpoint the problem. |
I suspect that this issue may be related to the out of memory problems. I used to get it quite a lot together with |
I tried to try/catch the code as requested by @filipesilva and discovered that the "message handler" is never invoked... then looking around for where the process is forked, I noticed this line on
Sounded strange to me on 32bit architecture, so I commented it out. After that TypeChecker message handler is invoked and the issue disappeared! |
So, in my opinion, @filipesilva you were right: #8306 fix this issue. |
Wanted to test what @bberto suggested, commenting out the Now the good thing is that I've tried I'll test it tomorrow with my real project and will report how it went. Here is the
|
@bberto @CramericaIndustries the fix in #8306 was released in 1.5.1 so that line ( @devoto13 now it uses the memory override of your main process (if any), so if your main process is running out of memory and you increase the limit, the child process will get the new limit as well. |
@filipesilva I can confirm that the error is gone. Thank you very much. Also thanks to @bberto ! |
Same here. Fixed with 1.5.1. Thanks! |
I've found a memory leak in the forked type checker. This only occurs when using The issue is opened in angular/angular#20691 and awaiting resolution. |
This PR will prevent the main thread for exiting when the forked type checker exists unexpectedly. A warning will be logged on the console when this happens: ``` WARNING in AngularCompilerPlugin: Forked Type Checker exited unexpectedly. Falling back to typechecking on main thread. ``` Fix #8331
This PR will prevent the main thread for exiting when the forked type checker exists unexpectedly. A warning will be logged on the console when this happens: ``` WARNING in AngularCompilerPlugin: Forked Type Checker exited unexpectedly. Falling back to typechecking on main thread. ``` Fix #8331
The combination of #8306, #8646 (released in CLI 1.5.5) and angular/angular#20692 (to be released in Angular 5.0.4) should address all the problems found here. If you still have problems when using CLI 1.5.5 with Angular 5.0.4 please let me know so we can reopen and investigate further. |
This PR will prevent the main thread for exiting when the forked type checker exists unexpectedly. A warning will be logged on the console when this happens: ``` WARNING in AngularCompilerPlugin: Forked Type Checker exited unexpectedly. Falling back to typechecking on main thread. ``` Fix angular#8331
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Bug Report or Feature Request (mark with an
x
)Versions.
Repro steps.
Then opened in Chrome. After editing a source file two times, I get the error below.
The log given by the failure.
Desired functionality.
Mention any other details that might be useful.
The text was updated successfully, but these errors were encountered: