Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

167
Views
build react router failed with error `Unexpected token (Note that you need plugins to import files that are not JavaScript)`

i just cloned the code from github,and run npm install -f

then run 'npm run build'

however,i got this error.

what happened?

> Executing task: npm run build <


> build
> rollup -c && tsc -b


packages/react-router/index.ts → build/node_modules/react-router/index.js...
Browserslist: caniuse-lite is outdated. Please run:
  npx browserslist@latest --update-db
  Why you should do it regularly: https://github.com/browserslist/browserslist#browsers-data-updating
copied:
  packages/react-router/package.json → build/node_modules/react-router/package.json
  packages/react-router/README.md → build/node_modules/react-router/README.md
  LICENSE.md → build/node_modules/react-router/LICENSE.md
(!) Circular dependency
packages/react-router/lib/hooks.tsx -> packages/react-router/lib/router.ts -> packages/react-router/lib/hooks.tsx
created build/node_modules/react-router/index.js in 400ms

packages/react-router/index.ts → build/node_modules/react-router/react-router.development.js...
[!] Error: Unexpected token (Note that you need plugins to import files that are not JavaScript)
packages/react-router/lib/hooks.tsx (328:36)
326:     invariant(
327:       parentPathnameBase === "/" ||
328:         parsedLocationArg.pathname?.startsWith(parentPathnameBase),
                                         ^
329:       `When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, ` +
330:         `the location pathname must begin with the portion of the URL pathname that was ` +
Error: Unexpected token (Note that you need plugins to import files that are not JavaScript)
    at error (/Users/kent/projects/react-router/node_modules/rollup/dist/shared/node-entry.js:5400:30)
    at Module.error (/Users/kent/projects/react-router/node_modules/rollup/dist/shared/node-entry.js:9824:16)
    at tryParse (/Users/kent/projects/react-router/node_modules/rollup/dist/shared/node-entry.js:9717:23)
    at Module.setSource (/Users/kent/projects/react-router/node_modules/rollup/dist/shared/node-entry.js:10080:33)
    at /Users/kent/projects/react-router/node_modules/rollup/dist/shared/node-entry.js:12366:20
    at async Promise.all (index 3)
    at async Promise.all (index 0)
    at async Promise.all (index 0)
    at async Promise.all (index 0)
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!