Answer the question
In order to leave comments, you need to log in
Error while building React Parcel?
"URI malformed" error occurs (React App(create-react-app + eject)
// src/index.js
import React from 'react';
import ReactDOM from 'react-dom';
import './index.scss';
import App from './App';
import * as serviceWorker from './serviceWorker';
ReactDOM.render(<App />, document.getElementById('root'));
serviceWorker.unregister();
// public/index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="theme-color" content="#000000">
<script src="https://apis.google.com/js/platform.js" async defer></script>
<link rel="manifest" href="%PUBLIC_URL%/manifest.json">
</head>
<body>
<noscript>
You need to enable JavaScript to run this app.
</noscript>
<div id="root"></div>
<script src="../src/index.js"></script>
</body>
</html>
Answer the question
In order to leave comments, you need to log in
I suspect %PUBLIC_URL% is not supported in Parcel out of the box.
In CRA, this works due to InterpolateHtmlPlugin , which is not present in Parcel.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question