Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/369.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/reactjs/23.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
Javascript 无法在共享服务器上托管create react应用程序生成,获取与chunk.js文件相关的404个错误_Javascript_Reactjs_Server_Build - Fatal编程技术网

Javascript 无法在共享服务器上托管create react应用程序生成,获取与chunk.js文件相关的404个错误

Javascript 无法在共享服务器上托管create react应用程序生成,获取与chunk.js文件相关的404个错误,javascript,reactjs,server,build,Javascript,Reactjs,Server,Build,我正在使用创建反应应用程序。在我创建构建之前,一切都正常 我运行: npm run build 构建已创建。然后我下载构建文件并通过cPanel上传到共享服务器 当我加载网站时,浏览器控制台中出现以下错误: Failed to load resource: the server responded with a status of 404 () main.a060bf3c.chunk.css:1 Failed to load resource: the server responded wit

我正在使用创建反应应用程序。在我创建构建之前,一切都正常

我运行:

npm run build
构建已创建。然后我下载构建文件并通过cPanel上传到共享服务器

当我加载网站时,浏览器控制台中出现以下错误:

Failed to load resource: the server responded with a status of 404 ()
main.a060bf3c.chunk.css:1 Failed to load resource: the server responded with a status of 404 ()
main.b69fe908.chunk.js:1 Failed to load resource: the server responded with a status of 404 ()
(index):1 GET my_url/static/css/main.a060bf3c.chunk.css net::ERR_ABORTED 404
(index):1 GET my_url/static/js/2.57e02e7f.chunk.js net::ERR_ABORTED 404
(index):1 GET my_url/static/js/main.b69fe908.chunk.js net::ERR_ABORTED 404
manifest.json:1 GET my_url/manifest.json 404
manifest.json:1 Manifest: Line: 1, column: 1, Syntax error.
我还将我的url添加到package.json中:

{
    "homepage" : my_url
}
我以前在使用FTP将构建目录传输到共享服务器时遇到过这个问题


Filezilla似乎正在删除大chunk.js文件。然而,使用cPanel确实有效,尽管现在不行。我是否需要进一步压缩chunk.js文件。这不是一个大型应用程序。

文件是否显示在ftp上(即使未剪切)

  • main.a060bf3c.chunk.css
  • 2.57e02e7f.chunk.js
  • main.b69fe908.chunk.js
  • manifest.json
如果它们不存在,那么您只是遇到了ftp连接问题

如果它们存在,您只需检查静态文件服务器配置,它可能不会在good目录下进行检查