I am currently trying to setup a dev environment to try and work on some plugins.
Due to beeing on a corporate managed computer where I can’t do virtualization currently, I am unable to run forklift and so resorting to running from source on a RHEL8 virtual server. I am following the contribution guide, but have encountered some issues along the way.
During bundle install and npm i, I saw a lot of EOL/deprecation warnings. I’ll assume you know about these and I can ignore them for now, but still wanted to mention it.
npm install failed, from what I can tell it is failing to install node-sass. I get this error:
The contribution guide explicitly tells you to enable nodejs:14 module stream, so thats what I did.
I switched to the nodejs:12 module stream just to test, but that got me the same result:
I don’t know if using nvm would make any difference, but since nodejs12 is EOL and 12.22.12 was the last version released, I assume that should give the same results.
Turns out this error was caused by me trying to install as root.
I managed to get npm to install all libraries as non-priviledged user, and I managed to get foreman to start.
Now I am having trouble connecting, though. The default config seems to only allow connections from localhost and binds the application to 127.0.0.1. I managed to get the frontend service to bind to 0.0.0.0 with bundle exec rails s -b 0.0.0.0 -p 3000 as mentioned in the github repo, but I cannot find a way to do this for webpack. Are there any options or some config file I can edit to bind webpack (or everything) to 0.0.0.0?
It probably is, but I am completly unable to find it.
As mentioned, I found a way to make the application accept connections from host other than localhost, but I can not find anything about the webpack stuff. Maybe I am missing something essential here or I am misunderstanding the concept or what’s supposed to happen, but when I run the application like described in the docs I either can’t access the app at all (first option starting everything in a single command) or I can reach the application server, but only get a blank screen and my browser console shows a lot of “failed to load script at host.example.com:3808/webpack/xyz.js” errors (second scenario with application and webpack started in seperate processes).
By now, I am starting to think about giving up, especially since the most urgent things we need have thankfully been addressed by other people around here in the plugins I intended to do some work on.
Your post had the hint I was looking for.
I managed to get it to work by changing line 53 of webpack.config.js to read: host: args.host || process.env.BIND || '0.0.0.0',
This seems to solve my problems with the setup, since both my local client as well as Foreman’s internal processes can now reach the webpack resources when starting the processes with your commands.