-
-
Notifications
You must be signed in to change notification settings - Fork 9.1k
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
ERROR TypeError: provider.ngAfterViewInit is not a function (Angular) #14696
Comments
After updating to 6.2 from 6.1 today, I started seeing this too. |
Does the problem go away if you use the legacy angular renderer? https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#new-angular-renderer |
@shilman Nope, still errors. |
Seems like the same issue as described here: #14147 (comment) |
Hey guys. I just wanted to add to this. I am having a similiar issue although not for the lifecycle hooks but rather for all methods. Not sure if it is related but it reads like it is: What I already found out is the following. Imagine this pseudo (!) angular component:
Now when the Inspector stops at The problem is solved using the legacy renderer but I would not consider this "solved" |
Hello, Thanks everybody for the responses and specially @Jakob-em because he shows us the workaround that works perfectly. It seems that the problem is the definition of the storybook props. Instead of this:
You should do this: Compodoc is the one that creates the problems, so there are couple of solutions in order to solve this problem:
More info here: #14147 (comment) @activenode do one of the two changes and you will be fine i guess. |
There is also a third solution: |
@Jakob-em that's fine too but wouldn't be much better if the filtering is done inside the |
I think the intention is that you can also override internal properties of your component in the story even if these properties are no inputs. |
Describe the bug
There is an error when we are trying to write a story for an Angular component that uses the interface "AfterViewInit" and its function "ngAfterViewInit". The error that we have on all browsers is:
To Reproduce
my-component.component.ts
my-component.stories.ts
System
System:
OS: macOS 10.15.4
CPU: (8) x64 Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz
Binaries:
Node: 14.4.0 - ~/.nvm/versions/node/v14.4.0/bin/node
npm: 6.14.5 - ~/.nvm/versions/node/v14.4.0/bin/npm
Browsers:
Chrome: 89.0.4389.128
Firefox: 54.0.1
Safari: 13.1
npmPackages:
@storybook/addon-actions: ^6.2.5 => 6.2.5
@storybook/addon-essentials: ^6.2.5 => 6.2.5
@storybook/addon-links: ^6.2.5 => 6.2.5
@storybook/angular: ^6.2.5 => 6.2.5
Extra Info
The error is present only the first time that we use the story and it goes away if we refresh the story (refresh from the browser)
The text was updated successfully, but these errors were encountered: