Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/reactjs/26.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Reactjs index.html仅显示从create react应用程序生成的部分组件_Reactjs_Create React App - Fatal编程技术网

Reactjs index.html仅显示从create react应用程序生成的部分组件

Reactjs index.html仅显示从create react应用程序生成的部分组件,reactjs,create-react-app,Reactjs,Create React App,以前,在运行warn build后打开index.html显示一个空白页面 我通过在我的package.json中添加“homepage”:“/”,设法让它显示一些东西 现在它确实显示了一些东西,但是缺少了很多组件。主要是它不呈现src/data/images中的任何图像 除此之外,浏览器还显示以下错误: Access to internal resource at 'file:///Users/josephliu/workspace/speedlimit_signs/build/manifes

以前,在运行
warn build
后打开index.html显示一个空白页面

我通过在我的package.json中添加
“homepage”:“/”
,设法让它显示一些东西

现在它确实显示了一些东西,但是缺少了很多组件。主要是它不呈现src/data/images中的任何图像

除此之外,浏览器还显示以下错误:

Access to internal resource at 'file:///Users/josephliu/workspace/speedlimit_signs/build/manifest.json' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, brave, chrome-untrusted, https.
以下是我的项目文件夹的外观:

project/
  build/
  public/
  src/
    components/
    data/
      train_images/
      test_images/   

结果是(这就是我使用的)一个文件://路径。因此,我改为使用HashRouter,它解决了问题

请分享您的代码,可能会出现一些问题,如不调用所需组件、提供错误目录或丢失路由等。当然,这里是github链接:我刚刚添加了一个更新。关于manifest.json有一个CORS错误