Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
ghost opened this issue Jun 22, 2021 · 3 comments
Open

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

ghost opened this issue Jun 22, 2021 · 3 comments

Comments

@ghost
Copy link

ghost commented Jun 22, 2021

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

[email protected] 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.)

@brienna
Copy link

brienna commented Jul 15, 2021

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
Copy link

I'm getting the same error as well

@stale
Copy link

stale bot commented Jan 9, 2022

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.

@stale stale bot added the stale label Jan 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants