jamesknelson / create-react-blog

Start and deploy your own statically rendered blog with create-react-app
https://create-react-blog.netlify.com/
MIT License
550 stars 69 forks source link

build error with public URL #8

Closed wulucxy closed 5 years ago

wulucxy commented 5 years ago

@jamesknelson great work!

I have a question:if I set PUBLIC_URL=/xxx/yyy/ in .env config,npm run build will throw an error:

.......
The project was built assuming it is hosted at /qingtong/papaya-blog/.
You can control this with the homepage field in your package.json.

The build folder is ready to be deployed.

Find out more about deployment here:

  http://bit.ly/CRA-deploy

navi-scripts: Using config at /work/FE/gatsby/react-blog/navi.config.js
Error: Could not load script: "/qingtong/papaya-blog/static/js/30.7a7c1dba.chunk.js"
    at onErrorWrapped (/work/FE/gatsby/react-blog/node_modules/jsdom/lib/jsdom/browser/resources/per-document-resource-loader.js:38:19)
    at Object.check (/work/FE/gatsby/react-blog/node_modules/jsdom/lib/jsdom/browser/resources/resource-queue.js:72:23)

actually,react-scripts build is ok,it seems navi-scripts have some problem with PUBLIC_URL

I can not find any document related to this in the project。

jamesknelson commented 5 years ago

This looks to be an issue in navi-scripts instead of this project, closing this for now.