◾️解決したい事象
manifest.jsonで指定されているpackされたjsが存在しない。
ChromeのConsole上も同様のエラーが表示され、画面が表示されない。
エラーメッセージ
![
※outputのパスを切り替えて再ビルドしてみたところ、
public/pucks/フォルダおよび、manifest.json(js指定つき)はできましたが、
manifest.jsonで指定されているjs/XXXXX.jsおよび、XXXXX.js.mapは作成されない状況です
◾️質問内容
①jsファイルが作成されないのが原因と思いますが、解決方法がわかればと。。
②js、js.mapファイルができるタイミングっていつなんでしょうか?
③outputのパス切り替え前の過去フォルダにjs、js.mapが大量に溜まっています。
tmp/cacheと合わせ、削除して良いのか?設定の問題かもご教示いただけると嬉しいです。。
よろしくお願いいたします。
◾️環境補足(足りなければ、ご指摘いただければと・・・)
・Ruby on Rails 2.6.3
関連gemとして以下を入れています。
-webpacker
-react-rails
【package.json】
{ "name": "app", "private": true, "dependencies": { "@babel/preset-react": "^7.0.0", "@fortawesome/fontawesome-svg-core": "^1.2.20", "@fortawesome/free-brands-svg-icons": "^5.10.0", "@fortawesome/free-regular-svg-icons": "^5.10.0", "@fortawesome/free-solid-svg-icons": "^5.10.0", "@fortawesome/react-fontawesome": "^0.1.4", "@material-ui/core": "^4.3.0", "@material-ui/icons": "^4.2.1", "@rails/webpacker": "^4.0.7", "babel-plugin-transform-react-remove-prop-types": "^0.4.24", "immutability-helper": "^3.0.1", "moment": "^2.24.0", "prop-types": "^15.7.2", "react": "^16.8.6", "react-datetime": "^2.16.3", "react-dom": "^16.8.6", "react-router-dom": "^5.0.1", "react-tabs": "^3.0.0", "react_ujs": "^2.5.0" }, "devDependencies": { "webpack-dev-server": "^3.7.2" } }
【manifest.json】
{ "application.js": "/packs/js/application-8d32689eab9fea0d09c6.js", "application.js.map": "/packs/js/application-8d32689eab9fea0d09c6.js.map", "entrypoints": { "application": { "js": [ "/packs/js/application-8d32689eab9fea0d09c6.js" ], "js.map": [ "/packs/js/application-8d32689eab9fea0d09c6.js.map" ] }, "server_rendering": { "js": [ "/packs/js/server_rendering-ac6c3e5d72cd59e80690.js" ], "js.map": [ "/packs/js/server_rendering-ac6c3e5d72cd59e80690.js.map" ] } }, "server_rendering.js": "/packs/js/server_rendering-ac6c3e5d72cd59e80690.js", "server_rendering.js.map": "/packs/js/server_rendering-ac6c3e5d72cd59e80690.js.map" }
【webpacker.yaml】
# Note: You must restart bin/webpack-dev-server for changes to take effect 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: - .jsx - .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: false # 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
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2019/08/19 01:22