-
Notifications
You must be signed in to change notification settings - Fork 12k
--build-optimizer errors "Cannot read property 'type' of undefined" #7110
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
After #7105, I have now a fresh working copy at dherges/ng-cli-build-optimizer-issue7110. I will try to reproduce the issue there and then give an update. |
I had a similar problem and solved it by replacing |
@rtm Yep, thanks! That's the cause! @filipesilva Here's the repro: dherges/ng-cli-build-optimizer-issue7110@4a19a56 @Hanfrey FYI ... Fehler erkannt, Fehler gebannt! 🐎 |
This shouldn't happen, and I think it's the same as angular/devkit#51. Will investigate. |
Hi, So are you saying you could still import the entire rxjs library:
But still see tree-shaking and just get what you need? Would certainly be less verbose than having to import all the different operators individually given the alternative import |
Im getting same issue - but dont think the import is "mis-aligned". Im using a 3rd party library which imports Observable bindCallback like this: and then my build results in:
|
I'm getting the same error when building and using a third party dependency ng2-responsive.
@ multi ./src/main.ts |
@bjornharvold are you using the latest version of the CLI? In this case it's |
Hi @filipesilva! Yes, that is correct.. Upgraded to 1.3.0 final today and tried the new optimize flag for the first time. |
I have the same issue, version 1.3.0 |
Please reopen this issue @hansl I habe the same issue with Angular CLI 1.3.0 and Angular 4.3.4 :(
|
Also seeing this same issue in 1.3.0. Please re-open. |
Same issue here :) |
+1 |
same issue here, had to update to TS 2.6... |
broken for me also! |
I'd like to take a look at this issue again but would really like a reproduction from someone that's suffering from this problem on TS 2.4.x, preferably with third party libs as well (as @tstrohecker mentioned in #7110 (comment)). I understand you all are running into this on your real projects and feel like you can't find the time to do a repro. But over 24 days since I last asked for a repro there were a total of 25 comments on this issue and not a single one offered a reproduction. You might think the way to reproduce this is really obvious and all the information is in the issue already, but that's because you are running into it and you know what to look for. I'm not running into the issue myself. So anything less than a repro I can follow is just me grasping at straws and trying to fix what I imagine is the problem, instead of what the problem you're actually facing is. Ideally a repro for this issue would include:
|
I can no longer reproduce it. I believe it was coming from a dependency on primeng , as well as my local changes. I did not realize importing rxjs/Rxjs had been blacklisted because my tslint file from a cli initialize was old. I was made aware by someone else on my team that it was blacklisted since their project was just initialized, so I replaced all instances. As far as the third party dependency, patched I guess ? |
Here you go. I had a similar issue in my project while using ng2-tree of version 2.0.0-rc.2. Up on searching about it, landed up on this page.
I tried to reproduce this same issue with cli-quickstart
Tried with typescript version "^2.6.0" after removing |
@avadhootha thank you, using your repro I can verify the problem. Using
Using My longer stacktrace also mentions Build Optimizer specifically. Build Optimizer doesn't need to use the same TS version as the CLI so I think we'll just update the version there. |
I was running into the same issue, even with all the imports correct. Upgrading TypeScript from 2.4.2 (default from Angular Cli) to 2.6.1 solved the issue without any other change. |
angular/devkit#299 should fix this. |
Fixed by angular/devkit#299, will be out on the next release. |
I have the same problem and I couldn't solve it. In my case, it was caused by the use of |
@patocardo Did you try |
@mbark, thanks to the poor documentation, I didn't know of that alternative source. I'll try it. |
You can configure TSLint to warn when there are imports like 'rxjs/Rx'. It avoids to meet problem when you use AOT instead of JIT. |
For me |
@jsubiratsgirbau i do not have problems importing Observable but there are problems in RXJS node_mdules in rxjs itself |
I've solved it installing [email protected] |
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.
Use a mis-aligned rxjs import:
The log given by the failure.
Desired functionality.
Whether that rxjs syntax should be build success? I don't think so!
A better error message is good!
Mention any other details that might be useful.
The text was updated successfully, but these errors were encountered: