question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Having trouble with CLI Ivy Hello World - Cannot read property 'type' of undefined

See original GitHub issue

I’m submitting a…


[X] Bug report  

Preconditions

  1. 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
  1. enable Ivy
  "angularCompilerOptions": {
    "enableIvy": true
  }
  1. Update boostrap
/*platformBrowserDynamic().bootstrapModule(AppModule)
  .catch(err => console.log(err));*/
  ɵrenderComponent(<any>AppComponent);
  1. 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:closed
  • Created 6 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

38reactions
IgorMinarcommented, Feb 19, 2018

@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.

  • @Ploppy3 tries to build a small app with ivy to test things, but encounters an error. He/She suspects that the problem is related to ivy not being finished, but is not sure, and really would love to see the magic working, so they post a comment asking for help/confirmation.
  • @trotyl sees the comment and wants to confirm that @Ploppy3’s problem is related to feature incompleteness of ivy. Rather than writing a full message, he copy & pastes a section of FAQ from @robwormald’s ivy demo.
  • @Ploppy3 sees the comment and feels patronized because the comment is very brief and explicitly mentions that people don’t file an issue if something is not working. @Ploppy3 then posts a new comment calling @trotyl “picky” and “patronizing”.

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:

  • @robwormald could improve his brief FAQ to be more easily used as a reference for further inquiries about ivy’s feature completeness.
  • @trotyl could be a bit more mindful about how his brief messages could be misinterpreted and try more to avoid that.
  • @Ploppy3 could interpret brief messages with a benefit of doubt and not assume bad intent when the message is ambiguous.

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 ɵ).

🖖

1reaction
Ploppy3commented, Feb 16, 2018

@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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found