create-react-app: Should not import the named export 'name' (imported as 'packageName') from default-exporting module (only default export is available soon)

Getting this error on upgrading react-scripts from 4.0.3 to 5.0.0. I have checked in code, import and export statements seems fine and not importing package.json in any file, but could not able to build it. Should not import the named export 'name' (imported as 'packageName') from default-exporting module (only default export is available soon) How to debug in which file it has errors. Any idea/suggestions to resolve it?

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Reactions: 20
  • Comments: 15

Most upvoted comments

We’re also affected by the same issue, and it is referencing an area of the code where imports are done as import * as name from 'path\to\file.json'. The reason we were doing it like this is that’s a JSON file.

One potential workaround for us is to change the import statement to be import name from 'path\to\file.json'.

However, this is not the official answer to this. I’m just trying to help.

Instead of importing the file this way import {SignUp} from './Users/SignUp'; , do it this way import SignUp from './Users/SignUp'; Basically, remove the curly braces “{}