Skip to content

npx create-react-app produces react app that will not compile. #11132

Open
@ghost

Description

Describe the bug

I started a fresh react application at my console by entering npx create-react-app my-app. Then, I changed my directory to my-app and ran the command npm start. When the application loaded in Chrome, it failed to compile...error given in console:

$ npm start

my-app@0.1.0 start
react-scripts start

i 「wds」: Project is running at http://10.0.0.215/
i 「wds」: webpack output is served from
i 「wds」: Content not from webpack is served from C:\Users\my-path\my-app\public
i 「wds」: 404s will fallback to /
Starting the development server...

Failed to compile.

./src/index.js 1:97
Module parse failed: Unexpected token (1:97)
File was processed with these loaders:

  • ./node_modules/@pmmmwh/react-refresh-webpack-plugin/loader/index.js
  • ./node_modules/babel-loader/lib/index.js
    You may need an additional loader to handle the result of these loaders.

R e f r e s h R u n t i m e = require('C:/Users/my-path/my-app/node_modules/react-refresh/runtime.js');
| R e f r e s h S e t u p (module.id);

Did you try recovering your dependencies?

Yes.

Which terms did you search for in User Guide?

(Write your answer here if relevant.)

Environment

(paste the output of the command here.)

Steps to reproduce

(Write your steps here:)

  1. In a shell window, create a react app using command [npx create-react-app my-app]
  2. Change directory to my-app and enter command [npm start]
  3. Wait for browser to open and note that the browser is displaying an error as is the shell used to run the commands in steps 1 and 2

Expected behavior

(Write what you thought would happen.)

Actual behavior

(Write what happened. Please add screenshots!)

Reproducible demo

(Paste the link to an example project and exact instructions to reproduce the issue.)

Activity

brienna

brienna commented on Jul 15, 2021

@brienna

I have the same issue with a fresh install.

./node_modules/@react-leaflet/core/esm/path.js 10:41
Module parse failed: Unexpected token (10:41)
File was processed with these loaders:
 * ./node_modules/babel-loader/lib/index.js
You may need an additional loader to handle the result of these loaders.
|   useEffect(function updatePathOptions() {
|     if (props.pathOptions !== optionsRef.current) {
>       const options = props.pathOptions ?? {};
|       element.instance.setStyle(options);
|       optionsRef.current = options;
Lucaslah

Lucaslah commented on Sep 22, 2021

@Lucaslah

I'm getting the same error as well

stale

stale commented on Jan 9, 2022

@stale

This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @brienna@Lucaslah

        Issue actions

          npx create-react-app produces react app that will not compile. · Issue #11132 · facebook/create-react-app