Skip to content
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

Angular: Fix for renamed method in angular 13.1 #17032

Merged
merged 1 commit into from Dec 18, 2021

Conversation

mandarini
Copy link
Contributor

@mandarini mandarini commented Dec 17, 2021

Issue: #16977
Broken build when on Angular v. 13,1

--> comment: #16977 (comment)

Quoting comment:
The problem is that in angular 13.1 the function getTypescriptWorkerPlugin changed names to getDevServerConfig
I was able to get it running by replacing all occurances of getTypescriptWorkerPlugin

What I did

Renamed the method to the new name - it's a bit ugly because it's using a ternary to see if old one exists - if not use new one. More proper way would be to check Angular version from lock file I guess...

How to test

Storybook for Angular 13.1 can now run without throwing the error TypeError: getTypescriptWorkerPlugin is not a function.

Disclaimer

I am not sure if we would need to add an extra check of the Angular version that's actually installed..

@nx-cloud
Copy link

nx-cloud bot commented Dec 17, 2021

☁️ Nx Cloud Report

CI ran the following commands for commit 854e374. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this branch


✅ Successfully ran 1 target

Sent with 💌 from NxCloud.

@shilman shilman changed the title (fix) renamed method in angular 13.1 to fix build Angular: Fix for renamed method in angular 13.1 Dec 18, 2021
Copy link
Member

@shilman shilman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice one @mandarini !! I like the simplicity of this one vs the previous PR.

@storybookjs/angular WDYT?

@shilman shilman merged commit c6c09d1 into storybookjs:next Dec 18, 2021
@literalpie
Copy link
Contributor

literalpie commented Dec 18, 2021

See this comment. As far as I know, removing the getTypescriptWorkerPlugin would also work. I'm not sure if the new configuration in getDevServerConfig is helpful in any way or not.

I do like the idea of using a ternary operator instead of a whole new config though. I think we might be able to also combine the configs for 12.2.x and 13.x since there is only a small difference between the two.

@shilman shilman added patch:yes Bugfix & documentation PR that need to be picked to main branch patch:done Patch/release PRs already cherry-picked to main/release branch labels Jan 10, 2022
shilman added a commit that referenced this pull request Jan 11, 2022
Angular: Fix for renamed method in angular 13.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
angular bug patch:done Patch/release PRs already cherry-picked to main/release branch patch:yes Bugfix & documentation PR that need to be picked to main branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants