Help us help you! Have you looked for similar issues? Do you have reproduction steps? Contributing Guide
(Guidelines for creating a bug report are available
here)
Server rendering in production should work the same as in development
Server rendering in production is not the same.
Sprockets or Webpacker version: 4.0
React-Rails version: "~> 2.3.1"
React_UJS version: "^2.5.0"
Rails version: "~> 5.2.0"
Ruby version: "2.6.3"
Hey there!
I'm having this issue for a couple of days now and don't know how to fix it.
I'm getting the following error on production:
No such file or directory @ rb_sysopen - public/js/server_rendering-7930ba59728fe68ecc97.js
This error is correct since no .js file is present with that name.
The actual path name is:
packs/js/server_rendering-7930ba59728fe68ecc97.js
Any idea where this problem is coming from? This code works perfectly in development but it seems wrong paths get assigned when deploying.
Any help in the right direction would be extremely helpful.
Kind regards
Jens
Yep. Have the same issue in the test environment.
I had exactly the same issue in development, running ./bin/webpack-dev-server fixes it. Maybe webpacker does not compile the correct packs on the go?
The root directory is usually sorted in the config/webpack.yml.
Could someone post a small example project or say if they have the same issue with a stock config?
Edit:
https://github.com/BookOfGreg/react-rails-example-app/blob/master/config/webpacker.yml#L3-L7
@BookOfGreg My config/webpacker.yml is completely stock, generated by rails webpacker:install and I can see some differences but still have this issue:
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
I had exactly the same issue in development, running
./bin/webpack-dev-serverfixes it. Maybe webpacker does not compile the correct packs on the go?
I confirm that this is the problem
```ruby
./bin/webpack-dev-server
Most helpful comment
I confirm that this is the problem
```ruby
./bin/webpack-dev-server