Having trouble with CLI Ivy Hello World - Cannot read property 'type' of undefined
See original GitHub issueI’m submitting a…
[X] Bug report
Preconditions
- New CLI project
ng new ivy
cd ivy
yarn add @angular/{animations,common,compiler,core,forms,http,platform-browser,platform-browser-dynamic,router,cli,compiler-cli,language-service}@next
- enable Ivy
"angularCompilerOptions": {
"enableIvy": true
}
- Update boostrap
/*platformBrowserDynamic().bootstrapModule(AppModule)
.catch(err => console.log(err));*/
ɵrenderComponent(<any>AppComponent);
ng serve
Current behavior
webpack-internal:///./node_modules/@angular/core/esm5/core.js:18628 Uncaught TypeError: Cannot read property 'type' of undefined
at runtime in the browser
Expected behavior
Hello World application renders.
Environment
Angular CLI: 1.7.0-rc.0
Node: 8.4.0
OS: linux x64
Angular: 6.0.0-beta.3
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router
@angular/cli: 1.7.0-rc.0
@angular-devkit/build-optimizer: 0.3.1
@angular-devkit/core: 0.3.1
@angular-devkit/schematics: 0.3.1
@ngtools/json-schema: 1.2.0
@ngtools/webpack: 1.10.0-rc.0
@schematics/angular: 0.3.1
@schematics/package-update: 0.3.1
typescript: 2.5.3
webpack: 3.10.0
Browser:
- [X] Chrome (desktop) version 64
Issue Analytics
- State:
- Created 6 years ago
- Comments:8 (5 by maintainers)
Top Results From Across the Web
ERROR in TypeError: Cannot read property 'flags' of ...
The issue seems to stem from using Angular CLI 9.1.4 with Angular 9.1.5 (most likely the compiler. You'll see the issue when you...
Read more >cannot read properties of undefined (reading 'module')
Your issue is that your .find() method is returning undefined , so you can't access properties on product such as .name as it...
Read more >Angular without angular cli for Angular 12.x and webpack 5.x
Angular version was updated to the 5.1.2 and while I am testing the post code, I have got the npm debs exceptions. It...
Read more >Cannot read property 'type' of undefined - forge/cli v1.3.3
Hi @i05, we are working on a fix for the issue you are facing. In the meantime, you should still be able to...
Read more >A Practical Guide to Angular Elements - Nitay Neeman's Blog
I've resolved the problem by loading JS bundle at the end of <body>, after my custom element usage instead of before it. ;)....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@Ploppy3 @trotyl let me step in for a bit. I see this happening all the time. So let’s step back and see what might have happened.
Most of the conversations that go down like this happen because we assume intention where there was none. I don’t believe that @trotyl was trying to be mean or patronizing. I see @trotyl comment on lots of issues and PRs, and sometimes when people post so frequently, they try to be as efficient as possible and use shortcuts to communicate the message (like copy&pasting existing documentation).
Github enables text-only communication form where no voice tone & emphasis, body language, or facial expressions can be observed by the message receiver. It’s these non-verbal communication channels that fill in the meaning, tone, and context in brief verbal interactions. In text communication, like the one that happened on this issue, we don’t have these additional communication channels available, which leaves brief text messages like the one from @trotyl, up for interpretation by the receiver (@Ploppy3). And often these interpretations are incorrect and result in a response that sends the whole conversation into downward spiral.
So where to go from here? I think that the following could help:
As I said, I see these kinds of interactions quite frequently, and I find it fascinating how different people handle them. I personally use https://www.npr.org/series/423302056/hidden-brain as a great resource to help me understand why is this happening. I highly recommend it.
Now to answer @Ploppy3’s original question: ivy is not feature complete yet, so many things still don’t work. You can follow the progress at ivy.angular.io. The bootstrap method has indeed changed and currently uses a private API called
ɵrenderComponent
which can be imported from@angular/core
. We expect it to change by the time ivy is ready for prime time, so please keep in mind that this is a private api (just as anything else prefixed withɵ
).🖖
@trotyl Why be so picky??? First I did not open an issue, I’m talking on a closed issue because I don’t want to waste people’s time. The linked project only partially answer the question because as I expected, it bootstraps a single component.
nb: If you don’t want to answer, just don’t, there is absolutely no need to do it in patronizing way.