Skip to content

Add nan as dev dependency to React templates (#22089) #22205

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

Merged
merged 1 commit into from
Jun 10, 2020

Conversation

captainsafia
Copy link
Member

Note: This is a cherry-pick of #22089 onto the 3.1 release branch.

Description

nan is an npm package that provides some helpful APIs for building native add-ons for Node. This package is a dependency of fsvents, another npm package that is used to watch for filesystem changes on macOS. The webpack dependency used by create-react-app brings in an older version of fsevents into our transitive dependencies but doesn't properly install the nan dependency.

This issue causes the npm install step to error our in our react and react-redux templates on macOS (since fsevents is a macOS-only package and other templates bring in the nan package to the dependency tree via other transitive dependencies).

To resolve this, we include nan as a dev dependency in the templates to ensure that it is installed.

Customer Impact

This issue was discovered during manual testing. It only impacts react and react-redux templates running on macOS.

This bug breaks the dotnet run and dotnet publish steps in the template project because the npm install step is unable to complete successfully as a result of the missing dependency.

As a workaround, customers can install the nan dependency manually in their ClientApp directories.

Regression?

This change contains no regressions.

Risk

The risk level of this change is low because:

  • nan is included as a dev dependency and shouldn't affect production or runtime environments
  • this fix was validated on the react and react-redux templates

Addresses https://github.com/aspnet/AspNetCore-ManualTests/issues/100

@captainsafia captainsafia added the Servicing-consider Shiproom approval is required for the issue label May 25, 2020
@ghost ghost added the area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates label May 25, 2020
@ghost
Copy link

ghost commented May 25, 2020

Hello human! Please make sure you've included the Shiproom Template in a comment or (preferably) the PR description. Also, make sure this PR is not marked as a draft and is ready-to-merge.

@mkArtakMSFT mkArtakMSFT added this to the 3.1.x milestone May 26, 2020
@leecow leecow added Servicing-approved Shiproom has approved the issue and removed Servicing-consider Shiproom approval is required for the issue labels May 26, 2020
@leecow leecow modified the milestones: 3.1.x, 3.1.6 May 26, 2020
@wtgodbe
Copy link
Member

wtgodbe commented Jun 10, 2020

@captainsafia the branch is open for 3.1.6, want me to merge this?

@captainsafia
Copy link
Member Author

@captainsafia the branch is open for 3.1.6, want me to merge this?

Yes.

@wtgodbe wtgodbe merged commit a529b4c into release/3.1 Jun 10, 2020
@wtgodbe wtgodbe deleted the safia/nan-fix-3.1 branch June 10, 2020 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates Servicing-approved Shiproom has approved the issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants