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

fix(angular): return error when name is missing from package.json #10356

Merged
merged 2 commits into from May 18, 2022

Conversation

Pascalmh
Copy link
Contributor

Current Behavior

Situation: You have a angular-cli app with a package.json that has no "name"-property

ng add @nrwl/angular
Skipping installation: Package already installed
Cannot read properties of undefined (reading 'startsWith')

Traced the error back to packages/angular/src/generators/ng-add/utilities/normalize-options.ts:38

Expected Behavior

Migration "just works" - somekind of fallback is used, or I am presented with an Error message so that I can fix the error.

@vercel
Copy link

vercel bot commented May 18, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Updated
nx-dev ⬜️ Ignored (Inspect) May 18, 2022 at 9:13AM (UTC)

Copy link
Member

@leosvelperez leosvelperez left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution!

I left a comment to make a change to the solution provided. The npmScope is not required so we shouldn't error and block the migration when we can't find the name in the package.json.

@leosvelperez leosvelperez force-pushed the angular-nx-add-no-name-in-package branch from cc967f5 to 11cf09f Compare May 18, 2022 09:10
Copy link
Member

@leosvelperez leosvelperez left a comment

Choose a reason for hiding this comment

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

LGTM! 🎉

I forced pushed the branch to kick-off CI.

Thanks again for contributing!

@leosvelperez leosvelperez merged commit 0de895d into nrwl:master May 18, 2022
@github-actions
Copy link

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 18, 2023
@Pascalmh Pascalmh deleted the angular-nx-add-no-name-in-package branch March 19, 2023 18:25
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants