Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

URI malformed in React Project - Using Parcel Bundler

Tags:

reactjs

parcel

I am experimenting with React project and parcel as the bundler. I am getting this error trying to run the command "dev":

Server running at http://localhost:1234 × C:\React\parcelreact\todoapp\public\index.html: URI malformed

This is a standard create-react-app project then added parcel-bundler..

This is my package.json "scripts" {}

 "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject",
    "dev": "parcel public/index.html",
    "run": "parcel build index.html"
  },

C:\React\parcelreact\todoapp\public\index.html: URI malformed at decodeURIComponent ()

What is the cause of this error? My index.html is indeed inside my public/ folder..

Help.?

like image 200
Jessa lauren Avatar asked Mar 21 '26 17:03

Jessa lauren


1 Answers

The problem is due to all of the values in the public/index.html that create-react-app creates that contains "%PUBLIC_URL%". If you modify these paths to be relative paths to the files they are pointing to you should be able to run your app using Parcel just fine.

like image 143
Brian Anderson Avatar answered Mar 23 '26 08:03

Brian Anderson