Webpack显示我的清单和文件,但是找不到应用程序文件。我在做什么错了?
我尝试查看所有其他Webpack Stack Overflow帖子,但我空着。我尝试了许多不同的方式来更新清单文件并对其进行调整。我希望有任何帮助或想法。我很茫然。
我还尝试了多个bin/rails asset:compile
,yarn upgrade
。
default: &default
source_path: app/javascript
source_entry_path: packs
public_root_path: public
public_output_path: packs <-- #tried changing this to packs/js, /public/packs/, and /public
cache_path: tmp/cache/webpacker
check_yarn_integrity: false
webpack_compile_output: false```
我也评论了:
# test:
# <<: *default
# compile: true
# # Compile test packs to a separate directory
# public_output_path: packs-test
这是我的heroku logs
:
[3cd9b180-aa40-4d64-90e0-0faa526ef075] ActionView::Template::Error (Webpacker can't find application in /app/public/packs/js/manifest.json. Possible causes:
2019-07-11T21:43:22.357757+00:00 app[web.1]: 1. You want to set webpacker.yml value of compile to true for your environment
2019-07-11T21:43:22.357758+00:00 app[web.1]: unless you are using the `webpack -w` or the webpack-dev-server.
2019-07-11T21:43:22.357761+00:00 app[web.1]: 2. webpack has not yet re-run to reflect updates.
2019-07-11T21:43:22.357762+00:00 app[web.1]: 3. You have misconfigured Webpacker's config/webpacker.yml file.
2019-07-11T21:43:22.357764+00:00 app[web.1]: 4. Your webpack configuration is not creating a manifest.
2019-07-11T21:43:22.357766+00:00 app[web.1]: Your manifest contains:
2019-07-11T21:43:22.357768+00:00 app[web.1]: {
2019-07-11T21:43:22.357770+00:00 app[web.1]: "application.js": "/packs/js/js/application-1ff77f857863096feba6.js",
2019-07-11T21:43:22.357772+00:00 app[web.1]: "application.js.map": "/packs/js/js/application-1ff77f857863096feba6.js.map",
2019-07-11T21:43:22.357774+00:00 app[web.1]: "entrypoints": {
2019-07-11T21:43:22.357775+00:00 app[web.1]: "application": {
2019-07-11T21:43:22.357777+00:00 app[web.1]: "js": [
2019-07-11T21:43:22.357778+00:00 app[web.1]: "/packs/js/js/application-1ff77f857863096feba6.js"
2019-07-11T21:43:22.357780+00:00 app[web.1]: ],
2019-07-11T21:43:22.357781+00:00 app[web.1]: "js.map": [
2019-07-11T21:43:22.357783+00:00 app[web.1]: "/packs/js/js/application-1ff77f857863096feba6.js.map"
2019-07-11T21:43:22.357784+00:00 app[web.1]: ]
2019-07-11T21:43:22.357786+00:00 app[web.1]: },
2019-07-11T21:43:22.357787+00:00 app[web.1]: "leadpage_link_tracking": {
2019-07-11T21:43:22.357789+00:00 app[web.1]: "js": [
2019-07-11T21:43:22.357791+00:00 app[web.1]: "/packs/js/js/leadpage_link_tracking-02f6f8905d3549cb8363.js"
2019-07-11T21:43:22.357792+00:00 app[web.1]: ],
2019-07-11T21:43:22.357794+00:00 app[web.1]: "js.map": [
2019-07-11T21:43:22.357795+00:00 app[web.1]: "/packs/js/js/leadpage_link_tracking-02f6f8905d3549cb8363.js.map"
2019-07-11T21:43:22.357797+00:00 app[web.1]: ]
2019-07-11T21:43:22.357798+00:00 app[web.1]: },
2019-07-11T21:43:22.357800+00:00 app[web.1]: "lists_link_tracking": {
2019-07-11T21:43:22.357801+00:00 app[web.1]: "js": [
2019-07-11T21:43:22.357803+00:00 app[web.1]: "/packs/js/js/lists_link_tracking-73fee18b1c576abf2be8.js"
2019-07-11T21:43:22.357804+00:00 app[web.1]: ],
2019-07-11T21:43:22.357806+00:00 app[web.1]: "js.map": [
2019-07-11T21:43:22.357807+00:00 app[web.1]: "/packs/js/js/lists_link_tracking-73fee18b1c576abf2be8.js.map"
2019-07-11T21:43:22.357809+00:00 app[web.1]: ]
2019-07-11T21:43:22.357810+00:00 app[web.1]: },
2019-07-11T21:43:22.357812+00:00 app[web.1]: "password_generator": {
2019-07-11T21:43:22.357813+00:00 app[web.1]: "js": [
2019-07-11T21:43:22.357815+00:00 app[web.1]: "/packs/js/js/password_generator-0deb3a261134a87e9636.js"
2019-07-11T21:43:22.357816+00:00 app[web.1]: ],
2019-07-11T21:43:22.357818+00:00 app[web.1]: "js.map": [
2019-07-11T21:43:22.357819+00:00 app[web.1]: "/packs/js/js/password_generator-0deb3a261134a87e9636.js.map"
2019-07-11T21:43:22.357821+00:00 app[web.1]: ]
2019-07-11T21:43:22.357822+00:00 app[web.1]: }
2019-07-11T21:43:22.357824+00:00 app[web.1]: },
2019-07-11T21:43:22.357825+00:00 app[web.1]: "leadpage_link_tracking.js": "/packs/js/js/leadpage_link_tracking-02f6f8905d3549cb8363.js",
2019-07-11T21:43:22.357827+00:00 app[web.1]: "leadpage_link_tracking.js.map": "/packs/js/js/leadpage_link_tracking-02f6f8905d3549cb8363.js.map",
2019-07-11T21:43:22.357829+00:00 app[web.1]: "lists_link_tracking.js": "/packs/js/js/lists_link_tracking-73fee18b1c576abf2be8.js",
2019-07-11T21:43:22.357830+00:00 app[web.1]: "lists_link_tracking.js.map": "/packs/js/js/lists_link_tracking-73fee18b1c576abf2be8.js.map",
2019-07-11T21:43:22.357832+00:00 app[web.1]: "password_generator.js": "/packs/js/js/password_generator-0deb3a261134a87e9636.js",
2019-07-11T21:43:22.357833+00:00 app[web.1]: "password_generator.js.map": "/packs/js/js/password_generator-0deb3a261134a87e9636.js.map"
2019-07-11T21:43:22.357835+00:00 app[web.1]: }
2019-07-11T21:43:22.357836+00:00 app[web.1]: ):
2019-07-11T21:43:22.357964+00:00 app[web.1]: F, [2019-07-11T21:43:22.357894 #19] FATAL -- : [3cd9b180-aa40-4d64-90e0-0faa526ef075] 10: <%= stylesheet_link_tag 'application', media: 'all' %>
2019-07-11T21:43:22.357966+00:00 app[web.1]: [3cd9b180-aa40-4d64-90e0-0faa526ef075] 11: <%= javascript_include_tag 'application' %>
2019-07-11T21:43:22.357967+00:00 app[web.1]: [3cd9b180-aa40-4d64-90e0-0faa526ef075] 12: <%= javascript_pack_tag 'application' %>
2019-07-11T21:43:22.357969+00:00 app[web.1]: [3cd9b180-aa40-4d64-90e0-0faa526ef075] 13: <%= stylesheet_pack_tag 'application' %>
2019-07-11T21:43:22.357970+00:00 app[web.1]: [3cd9b180-aa40-4d64-90e0-0faa526ef075] 14: </head>
2019-07-11T21:43:22.357972+00:00 app[web.1]: [3cd9b180-aa40-4d64-90e0-0faa526ef075] 15:
2019-07-11T21:43:22.357974+00:00 app[web.1]: [3cd9b180-aa40-4d64-90e0-0faa526ef075] 16: <body>```
Here's my webpack.yml file:
```default: &default
source_path: app/javascript
source_entry_path: packs
public_root_path: public
public_output_path: packs
cache_path: tmp/cache/webpacker
check_yarn_integrity: false
webpack_compile_output: false
# Additional paths webpack should lookup modules
# ['app/assets', 'engine/foo/app/assets']
resolved_paths: []
# Reload manifest.json on all requests so we reload latest compiled packs
cache_manifest: false
# Extract and emit a css file
extract_css: false
static_assets_extensions:
- .jpg
- .jpeg
- .png
- .gif
- .tiff
- .ico
- .svg
- .eot
- .otf
- .ttf
- .woff
- .woff2
extensions:
- .mjs
- .js
- .sass
- .scss
- .css
- .module.sass
- .module.scss
- .module.css
- .png
- .svg
- .gif
- .jpeg
- .jpg
development:
<<: *default
compile: true
# Verifies that correct packages and versions are installed by inspecting package.json, yarn.lock, and node_modules
check_yarn_integrity: true
# Reference: https://webpack.js.org/configuration/dev-server/
dev_server:
https: false
host: localhost
port: 3035
public: localhost:3035
hmr: false
# Inline should be set to true if using HMR
inline: true
overlay: true
compress: true
disable_host_check: true
use_local_ip: false
quiet: false
headers:
'Access-Control-Allow-Origin': '*'
watch_options:
ignored: '**/node_modules/**'
# test:
# <<: *default
# compile: true
# # Compile test packs to a separate directory
# public_output_path: packs-test
production:
<<: *default
# Production depends on precompilation of packs prior to booting for performance.
compile: false
# Extract and emit a css file
extract_css: true
# Cache manifest.json for performance
cache_manifest: true