URI malformed in React Project - Using Parcel Bundler

Viewed 1084

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.?

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.

Related