📅  最后修改于: 2023-12-03 15:35:40.641000             🧑  作者: Mango
这是一个rails应用中可能出现的错误,在使用Webpacker和Rails一起开发时,将JavaScript和CSS文件打包成bundled assets。当Webpack编译器无法发现特定的entry point时,该错误将抛出。
此错误通常出现在两种情况下:
下面是解决此错误的步骤:
Webpacker::Manifest::MissingEntryError in Events#index
Webpacker can't find bundle for event-bundle in /path-to-project/public/packs/manifest.json. Possible causes:
1. You want to set webpacker.yml value of compile to true for your environment
unless you are using the `webpack -w` or the webpack-dev-server.
2. webpack has not yet re-run to reflect updates.
3. You have misconfigured Webpacker's config/webpacker.yml file.
4. Your webpack configuration is not creating a manifest.
5. Your manifest contains:
{
"application.js": "/packs/js/application-e8ffcdb5a13831c0515c.js",
"application.css": "/packs/css/application-0c53e95bc7ecc9e166bb.css",
"entry1.js": "/packs/js/entry1-764f6d8409c68f5d8d71.js",
"entry1.css": "/packs/css/entry1-0c53e95bc7ecc9e166bb.css",
}
but your entrypoint file is missing - check that it exists and contains a
javascript tag with 'entry1' or 'data-turbolinks-track': 'reload'
以上例子展示了一个错误信息,提示webpacker找不到entry point。最后一行也给出了一些提示,可能的原因是entry point文件不存在或没有正确配置manifest文件。在解决此问题时,请详细检查这些可能的原因。