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
StaticSymbolResolver - TypeError: Cannot read property 'length' of undefined #15188
Comments
Please add the github repo that reproduces the issue |
@DzmitryShylovich It's a private repo. I'm not allowed. |
We don't need your real code. Just a small demo. Otherwise we can't do anything. |
@DzmitryShylovich can you please tell me what the StaticSymbolResolver does so I can narrow it down to something more meaningful? I don't know what to send. Unfortunately, there has been some time between AOT compilations and there are quite a few changes.... |
@chuckjaz why can staticSymbol.members be undefined? |
@DzmitryShylovich @paistipoikka Unfortunately, the stack only tells me that there is a bug, not what is causing it. You can try adding a |
@DzmitryShylovich @chuckjaz Thanks guys, that worked. It turned out that I was using the wrong provider key in one of my modules. I switched it out for an OpaqueToken and voila, problem solved. For example, LOGGING_ERROR_HANDLER_OPTIONS here can not be used as a provider key:
this breaks. Instead, set up an opaque token and use that. Many thanks for your help. JT |
I got (angular 4)
|
I managed to replicate it when compiling with AOT. Adding this in your module: Will error out:
The error message did not help at all, I digged it out with @chuckjaz suggestion to console.log(compilerIdentifier). Thanks for the tip. |
@paistipoikka What changes did you make exactly to convert this to an opaque token? I'm still trying to wrap my head around AoT and I'm running into the same error with Error Logging. |
@M-R-Bishop try the suggestion offered above by @chuckjaz That should give the clues as to what has caused the error. |
Thank you very much for this thread. I'm on 4.2.4 and was getting a similar error:
This is a year old app that was started before AOT so we are having to unwind some bad practices. We had this in our App Module providers section: WindowService,
{
provide: Window,
useValue: window
} I got rid of the bad provide and that fixed it. |
@dparish Does this reproduce with 0.1.4? Adding this above code to an existing application and could not reproduce it. |
I tried it on 1.4.2 and 1.5.0-rc.1. Failed on both. |
@dparish It is not that I don't believe you. I do. I just was unable to reproduce it. Can you put together a small example such as using |
@chuckjaz I can confirm that this still happens, using Angular 4.2.5 - not using the CLI, and making the AOT build from scratch. Unfortunately, I can't provide you my code because it's a particular project. But I had the same provider registered ( Here, the error was even weird, it said: |
This looks related to #15495 which is no longer an issue with Ivy, so closing as resolved. |
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. |
I'm submitting a ... (check one with "x")
Current behavior
When trying to do an AOT compilation the following error is received:
Expected behavior
Checks for the undefined object or throws a more meaningful error message.
In its current form, I have no idea what is wrong....
Minimal reproduction of the problem with instructions
What is the motivation / use case for changing the behavior?
Easier debugging
Please tell us about your environment:
OS X
Angular Class Webpack AOT
NPM
Angular 2.4.9
Language: [all | TypeScript X.X | ES6/7 | ES5]
TS 2.2.1
"target": "es5",
"module": "es2015",
Node (for AoT issues):
node --version
= Node 7.5.0The text was updated successfully, but these errors were encountered: