Naweed Ahmed
Naweed Ahmed

Reputation: 1

Getting react build failed to compile

I am getting following error while react-scripts build:

> react-scripts build

Creating an optimized production build...
Failed to compile.

Attempted import error: '__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE' is not exported from 'react' (imported as 'React').

enter image description here

The same issue is happening in Azure CI/CD pipeline as well in local.

Tried deleting yarn.lock file and node_modules folder.

Also tried re-running the Azure build pipeline but the result is same and there is no code change in Azure pipeline. I just tried running the Azure build pipeline again manually.

Upvotes: 0

Views: 62

Answers (1)

rschristian
rschristian

Reputation: 2967

That's a new/renamed export that's only available in React 19 (which is still in beta & not fully released yet). You're likely using React 18 or older.

You'll have to track down where that's used and correct the library version that tries to import that (unless you're trying to access that yourself in your app's code).

Upvotes: 0

Related Questions