Skip to content

Add nan as dev dependency to React templates #22089

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
May 21, 2020

Conversation

captainsafia
Copy link
Member

@captainsafia captainsafia commented May 21, 2020

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

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

ghost commented May 21, 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.

Copy link
Contributor

@mkArtakMSFT mkArtakMSFT left a comment

Choose a reason for hiding this comment

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

Thanks @captainsafia!

@mkArtakMSFT
Copy link
Contributor

This was approved already to be merged.

@mkArtakMSFT mkArtakMSFT added Servicing-approved Shiproom has approved the issue and removed Servicing-consider Shiproom approval is required for the issue labels May 21, 2020
Copy link
Contributor

@dougbu dougbu left a comment

Choose a reason for hiding this comment

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

Looks good though I think you meant indirect and not transient 😺

@mkArtakMSFT mkArtakMSFT merged commit 024130e into release/5.0-preview5 May 21, 2020
@mkArtakMSFT mkArtakMSFT deleted the safia/react-tpl-fix branch May 21, 2020 21:43
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.

3 participants