Naweed Ahmed
Naweed Ahmed

Reputation: 1

Getting "Attempted import error: '__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE' " in react app

I am receiving the following error when trying to run my React app:

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').

Tried deleting yarn.lock file and node_modules folder.

Tried updating react and react-dom

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.

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: 79

Answers (1)

sori
sori

Reputation: 536

Usually you get this kind of error when there is a version mismatch between packages.

As a first attempt, if you haven’t already tried, would be to also clear the cache with yarn cache clean or npm cache clean -f

If you are using yarn, I suggest you try running yarn why and check for any package that might be “clashing” with react like for instance any libraries that manipulate React internals or UI component libraries.

Upvotes: 0

Related Questions