Skip to content
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

[Bug]: when starting the application --- Module parse failed #11349

Closed
quant12345 opened this issue Mar 15, 2024 · 1 comment
Closed

[Bug]: when starting the application --- Module parse failed #11349

quant12345 opened this issue Mar 15, 2024 · 1 comment
Labels

Comments

@quant12345
Copy link

What version of React Router are you using?

6.22.3

Steps to Reproduce

Created an application: npx create-react-app my_app
installed: npm install react-router-dom

connected modules:

import {
  createBrowserRouter,
  RouterProvider,
} from "react-router-dom";

start application:
npm start

Expected Behavior

I expect the application to work.

Actual Behavior

I get the following:

Failed to compile.

Error in ./~/react-router-dom/dist/umd/react-router-dom.development.js
Module parse failed: /....../roureact/node_modules/react-router-dom/dist/umd/react-router-dom.development.js Unexpected token (565:79)
You may need an appropriate loader to handle this file type.
SyntaxError: Unexpected token (565:79)
 @ ./~/react-router-dom/dist/main.js 18:19-67

also after installing react-router-dom I got the following:

added 3 packages, and audited 988 packages in 5s

42 packages are looking for funding
  run `npm fund` for details

107 vulnerabilities (7 low, 52 moderate, 30 high, 18 critical)

To address issues that do not require attention, run:
  npm audit fix

To address all issues (including breaking changes), run:
  npm audit fix --force

Run `npm audit` for details.

package.json

{
  "name": "roureact",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "react-router-dom": "^6.22.3",
    "react-scripts": "0.9.5"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test --env=jsdom",
    "eject": "react-scripts eject"
  }
}
@quant12345 quant12345 added the bug label Mar 15, 2024
@quant12345
Copy link
Author

I figured out when installing the application, the old version of "react-scripts" is installed. I'll close the question in a couple of days.

@timdorr timdorr closed this as completed Mar 15, 2024
@remix-run remix-run deleted a comment from b191031-GNANESHWAR Mar 21, 2024
@remix-run remix-run locked as resolved and limited conversation to collaborators Mar 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants