简体   繁体   English

Laravel(共享托管)-文件未在资产清单中定义

[英]Laravel(Shared hosting) - File not defined in asset manifest

I'm trying to running a laravel project in a shared hosting but i'm having the error: File css/app-backend.css not defined in asset manifest . 我正在尝试在共享主机中运行laravel项目,但出现错误: File css/app-backend.css not defined in asset manifest

My folder structure is that: 我的文件夹结构是:

- .htaccess
- css
- js
- laravel-code
- index.php

I edit the index.php : 我编辑index.php

require __DIR__.'/laravel-code/bootstrap/autoload.php';
$app = require_once __DIR__.'/laravel-code/bootstrap/app.php';

I also change the src of css and js files. 我还更改了css和js文件的src。 Instead elixir i change to asset. 相反,长生不老药我改为资产。

How can i solve that? 我该如何解决?

Thank you 谢谢

It looks like you're missing or have an outdated manifest file from the /public folder. 似乎您丢失了/ public文件夹中的清单文件已过时或过时。

When you use the asset() function it looks to a /public/manifest.json file to determine which files it loads ( for things like using versioning with elixir you can just reference 'js/app.js' and it'd really point to 'js/app.1980L1209.js ) 当您使用asset()函数时,它会查找/public/manifest.json文件以确定要加载的文件(例如,使用elixir进行版本控制时,您只需引用“ js / app.js”,它就可以指向到'js / app.1980L1209.js)

I can't pinpoint it exactly but I'd look to your manifest file for some more insight. 我无法确切指出它,但是我希望您的清单文件有更多的见解。

It may be because you have not updated the server.php file. 可能是因为您尚未更新server.php文件。 Try updating line 21 to this 尝试将第21行更新为此

require_once __DIR__.'/laravel-code/public/index.php';

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM