Skip to content

Webpack 2 bug: "ReferenceError: exports is not defined" #2160

@gaearon

Description

@gaearon

Cross-posting from webpack/webpack#3974 (comment) for visibility.


I can consistently reproduce this in CRA codebase:

git clone https://github.com/facebookincubator/create-react-app.git
cd create-react-app
git checkout 9e733b57f8ae7ae3df46d95910d255798107448f
npm install

npm start

Then edit packages/react-scripts/template/src/App.js to have an empty block in the render method:

screen shot 2017-05-15 at 4 35 15 pm

Press save. The browser will reload.

Then edit it to remove the empty block and press save.

You will see the error:

screen shot 2017-05-15 at 4 36 23 pm

Unfortunately some internal state appears corrupted because even if I refresh the page, I keep getting the broken bundle. It only gets fixed by a restart of the server.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions