Closed kingpalethe closed 4 years ago
For what it's worth, this error seems to be solved (so far)
Failed to load https://xxxx.c9users.io:8082/sockjs-node/info?t=1523421350452: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://xxxxx.c9users.io' is therefore not allowed access. The response had HTTP status code 503.
It's solved by commenting out these lines in the start
script
# Adapt the configuration of the webpack-dev-server
export APP_DOMAIN="${C9_HOSTNAME}"
export RAILS_SERVER_BINDING='0.0.0.0'
export RAILS_SERVER_PORT='8080'
# export WEBPACKER_DEV_SERVER_PORT='8082'
# export WEBPACKER_DEV_SERVER_HTTPS='true'
# export WEBPACKER_DEV_SERVER_HOST="localhost"
# export WEBPACKER_DEV_SERVER_PUBLIC="${C9_HOSTNAME}:${WEBPACKER_DEV_SERVER_PORT}"
# export WEBPACKER_DEV_SERVER_HMR='false'
# export WEBPACKER_DEV_SERVER_INLINE='false'
# export WEBPACKER_DEV_SERVER_OVERLAY='true'
# export WEBPACKER_DEV_SERVER_DISABLE_HOST_CHECK='true'
# export WEBPACKER_DEV_SERVER_USE_LOCAL_IP='false'
... and then hard-coding these values in webpacker.yml
dev_server:
https: true
host: localhost
port: 8082
public: xxxxxxxx.c9users.io:8082
hmr: false
inline: false
overlay: true
disable_host_check: true
use_local_ip: false
This fix doesn't seem to solve the issue where the webpacker-dev-server disappears.... after stopping the application, and trying to start it again, I still get this error
14:16:51 webpacker.1 | /usr/local/rvm/gems/ruby-2.5.1/gems/webpacker-3.4.3/lib/webpacker/dev_server_runner.rb:47:in `exec': No such file or directory - /home/ubuntu/workspace/factbar/node_modules/.bin/webpack-dev-server (Errno::ENOENT)
14:16:51 webpacker.1 | from /usr/local/rvm/gems/ruby-2.5.1/gems/webpacker-3.4.3/lib/webpacker/dev_server_runner.rb:47:in `block in execute_cmd'
14:16:51 webpacker.1 | from /usr/local/rvm/gems/ruby-2.5.1/gems/webpacker-3.4.3/lib/webpacker/dev_server_runner.rb:46:in `chdir'
14:16:51 webpacker.1 | from /usr/local/rvm/gems/ruby-2.5.1/gems/webpacker-3.4.3/lib/webpacker/dev_server_runner.rb:46:in `execute_cmd'
14:16:51 webpacker.1 | from /usr/local/rvm/gems/ruby-2.5.1/gems/webpacker-3.4.3/lib/webpacker/dev_server_runner.rb:11:in `run'
14:16:51 webpacker.1 | from /usr/local/rvm/gems/ruby-2.5.1/gems/webpacker-3.4.3/lib/webpacker/runner.rb:6:in `run'
Someone smarter than me should probably take a look at these directions, my guess is that something here is now outdated: https://github.com/rails/webpacker/blob/master/docs/cloud9.md
Is this issue still relevant ?
Can it be closed if not ?
I have been developing an application with webpacker/rails 5.2.
I have found 4 or 5 problems, and I can't tell which is related to which.
I am able to run the dev server, but I do have to tolerate this error appearing in the chrome console every three seconds.
That is actually a best-case scenario. The really bad stuff seems to happen at random, like when I sit down to use the dev server after not having done it for a few hours. Suddenly, the dev server won't load in the browser, and in the Chrome console, I see this error message:
Interestingly, I have found the above error to be intermittent.... sometimes I can make it go away just by refreshing the web page a few times. This makes me think there might be a race condition somewhere.
So. I do roughly have a process to get the server back and running again... it take 5 to 10 minutes. To fix it, I do the following process:
PS
.)To fix this error, I run these commands
These commands produce quite a lot of confusing errors, like:
However, I can now boot rails and webpacker with my startup script (see startup script below)
The development app now loads, but now, every 3 seconds or so, I see this in the chrome console:
I am guessing that this has something to do with hot module reloading.... and even though I see this error, I am still able to use the development server.
Typically at this point I CAN continue to use Webpack dev server for a few hours, but if I ever need to stop it and start it again, I need to start at the beginning and run through all of these errors again.
Here is a complete documentation of my environment:
Host: Cloud9 / Ubuntu 14.04
This is the bash script I am using to start rails and webpacker
This is my
Procfile.dev
This is my
Webpacker.yml
This is my Gemfile
This is my
package.json
This is in
config/initializers/content_security_policy.rb
Note -- I have tried these other troubleshooting steps.
yarn install