Skip to content

ReferenceError: require is not defined (create-react-app v2.0) #20

Open
@sartaj10

Description

@sartaj10

Hi,

I recently upgraded my project to use the create-react-app v2.0 and I'm getting this error

screen shot 2018-10-19 at 10 51 32 am

The issue seems to be around the fact that with this update, they have removed support for .mjs extensions as seen below

screen shot 2018-10-19 at 10 53 18 am

Here are a couple of links that I found that seem to fix the problem for other packages
facebook/create-react-app#4318
jaredpalmer/razzle@39ea3a6#diff-4fc6a7be00756e3dbc6b0eac82ea10e5R145

NOTE : This worked fine with create-react-app V1.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions