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

[0.76] NU1004: The package references have changed for native with New Arch enabled #13914

Closed
Tracked by #2131
tido64 opened this issue Oct 2, 2024 · 1 comment · Fixed by #13916
Closed
Tracked by #2131
Assignees
Milestone

Comments

@tido64
Copy link
Member

tido64 commented Oct 2, 2024

Problem Description

Building RNW with New Architecture enabled, I get this error:

× Build failed with message 1>D:\react-native-test-app\node_modules\react-native-windows\Microsoft.ReactNative\Microsoft.ReactNative.vcxproj : error NU1004: The package references have changed for native. Lock file's package references: boost:[1.83.0, ), Microsoft.JavaScript.Hermes:[0.1.23, ), Microsoft.SourceLink.GitHub:[1.1.1, ), Microsoft.Windows.CppWinRT:[2.0.230706.1, ), Microsoft.WindowsAppSDK:[1.5.240227000, ), project's package references: boost:[1.83.0, ), Microsoft.JavaScript.Hermes:[0.1.23, ), Microsoft.Windows.CppWinRT:[2.0.230706.1, ), Microsoft.WindowsAppSDK:[1.5.240227000, ).The packages lock file is inconsistent with the project dependencies so restore can't be run in locked mode. Disable the RestoreLockedMode MSBuild property or pass an explicit --force-evaluate option to run restore to update the lock file. [D:\react-native-test-app\example\windows\Example.sln]. Check your build configuration.

Where Microsoft.SourceLink.GitHub is no longer present. Removing node_modules/react-native-windows/Microsoft.ReactNative/packages.fabric.lock.json gets me further.

Looking in the npm package, I see packages.fabric.lock.json and packages.lock.json are present. Should they be included in the package?

Steps To Reproduce

n/a

Expected Results

No response

CLI version

14.1.1

Environment

n/a

Community Modules

No response

Target Platform Version

10.0.22621

Target Device(s)

Desktop

Visual Studio Version

Visual Studio 2022

Build Configuration

Debug

Snack, code example, screenshot, or link to a repository

No response

@tido64 tido64 added the bug label Oct 2, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs: Triage 🔍 New issue that needs to be reviewed by the issue management team (label applied by bot) label Oct 2, 2024
@jonthysell
Copy link
Contributor

Two issues:

  1. Yes, the lock files shouldn't be present in the npm package.
  2. Building new arch against source out of this repo is not officially supported, please use the nugets as per the cpp-app template

@chrisglein chrisglein added Area: Infrastructure and removed Needs: Triage 🔍 New issue that needs to be reviewed by the issue management team (label applied by bot) labels Oct 3, 2024
@chrisglein chrisglein added this to the Next milestone Oct 3, 2024
jonthysell added a commit that referenced this issue Oct 3, 2024
## Description

Removes the `packages.lock.json` and `packages.fabric.lock.json` files from our published NPM packages, as customers who choose to build M.RN themselves don't necessarily choose the same dependencies as us (such as SourceLink).

### Type of Change
- Bug fix (non-breaking change which fixes an issue)

### Why
See above.

Resolves #13914 

### What
Added filters to the NPM `package.json` files to exclude these lock files.

## Screenshots
N/A

## Testing
Verified with `npm pack` that new packages do not contain these files.

## Changelog
Should this change be included in the release notes: _no_
jonthysell added a commit to jonthysell/react-native-windows that referenced this issue Oct 3, 2024
…13916)

## Description

Removes the `packages.lock.json` and `packages.fabric.lock.json` files from our published NPM packages, as customers who choose to build M.RN themselves don't necessarily choose the same dependencies as us (such as SourceLink).

### Type of Change
- Bug fix (non-breaking change which fixes an issue)

### Why
See above.

Resolves microsoft#13914

### What
Added filters to the NPM `package.json` files to exclude these lock files.

## Screenshots
N/A

## Testing
Verified with `npm pack` that new packages do not contain these files.

## Changelog
Should this change be included in the release notes: _no_
jonthysell added a commit that referenced this issue Oct 4, 2024
…13923)

* [0.76] Exclude NuGet package lock files from NPM packages (#13916)

## Description

Removes the `packages.lock.json` and `packages.fabric.lock.json` files from our published NPM packages, as customers who choose to build M.RN themselves don't necessarily choose the same dependencies as us (such as SourceLink).

### Type of Change
- Bug fix (non-breaking change which fixes an issue)

### Why
See above.

Resolves #13914

### What
Added filters to the NPM `package.json` files to exclude these lock files.

## Screenshots
N/A

## Testing
Verified with `npm pack` that new packages do not contain these files.

## Changelog
Should this change be included in the release notes: _no_
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

Successfully merging a pull request may close this issue.

3 participants