在主页#index中出现了Webpacker::Manifest::MissingEntryError错误 在显示/Users/khalidhosein/Desktop/myEPKmedia/builder/khalid101/app/views/layouts/embedded_app.html.erb文件时,第7行引发了该错误:
Webpacker can't find hello_react.js in /Users/khalidhosein/Desktop/myEPKmedia/builder/khalid101/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.
Your manifest contains:
{
"application.js": "/packs/application-68dcba18197451fbb79e.js",
"application.js.map": "/packs/application-68dcba18197451fbb79e.js.map"
}
Extracted source (around line #7):
5
6
7
8
9
10
<% application_name = ShopifyApp.configuration.application_name %>
<title><%= application_name %></title>
<%= javascript_pack_tag 'hello_react' %>
<%= stylesheet_link_tag 'application' %>
<%= javascript_include_tag 'application', "data-turbolinks-track" => true %>
<%= csrf_meta_tags %>
Rails.root: /Users/khalidhosein/Desktop/myEPKmedia/builder/khalid101
Application Trace | Framework Trace | Full Trace
app/views/layouts/embedded_app.html.erb:7:in `_app_views_layouts_embedded_app_html_erb___4509380428416253144_70127991029820'
Request
Parameters:
None
我在尝试将我的Rails应用与React前端连接时遇到了这个错误。我已经尝试从各种来源进行研究和重新配置文件。我还重新创建了manifiest.json文件和packs库。我正在遵循这个教程:
https://github.com/natemacinnes/natemacinnes.github.io/blob/master/rails-5-shopify-app-setup.md
如果有任何想法,将不胜感激,因为目前没有太多关于连接Rails Shopify API和React的文档或教程。
我的代码如下——>https://github.com/KhalidH82/ShopifyApp-React-Rails
bundle exec rake webpacker:compile
,编译 Webpacker。 - Indra