-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
build(dev): fix shakpacker config for the webpack-dev-server #2280
Conversation
I'm getting a lot of errors with this when doing a fresh install... gotta see what can be done about them
|
@jhmegorei is that the jq thing (#2278 just merged) ? |
LCOV of commit
|
- rm erb from shakapacker.yml as it appears to not be interpreted when starting skakapacker dev server - rm devServer config from webpack/development.js as the whole block take precedence over the one in shakapacker.yml - add watchOptions to ensure node_modules are ignored
no that is way before. It's during the installation process. Apparently openssl does not compile successfully, which in turn breaks the ruby installation. And there is something about the nodejs version, which I haven't looked at yet
|
196d297
to
ef3980b
Compare
LCOV of commit
|
199548b
to
9d9e751
Compare
LCOV of commit
|
LCOV of commit
|
9d9e751
to
ef3980b
Compare
LCOV of commit
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I managed to re-build the devcontainer from the current main
(b875f69) without the changes in this PR:
- Remove everything associated with the devcontainer:
docker compose -f docker-compose.dev.yml down --rmi all -v --remove-orphans
. - Re-build only
app
:docker compose -f docker-compose.dev.yml up app
. - Once 3. has finished, start the devcontainer as usual.
it is not happening when using the current docker-compose.dev.yml because SHAPACKER_DEV_SERVER_HOST and SHAPACKER_DEV_SERVER_PORT are set there: it leads to skip reading the corresponding values from shakapacker.yml. here how to reproduce: commit 3879fe6e890a85f2846fc00fe0124d1372529477 (HEAD -> how_to_reproduce_2280)
Author: PiTrem <[email protected]>
Date: Fri Jan 17 15:10:30 2025 +0100
buggit: show that erb not working in shakapacker.yml
rename the default env variable
in docker-compose.yml to avoid that shakapacker.rb skips
settings the host and port with the values from shakapacker.yml
diff --git a/config/shakapacker.yml b/config/shakapacker.yml
index 05d364050..32c485919 100644
--- a/config/shakapacker.yml
+++ b/config/shakapacker.yml
@@ -66,8 +66,8 @@ development:
# For running dev server with https, set `server: https`.
# server: https
- host: <%= ENV['SHAPACKER_DEV_SERVER_HOST'] || 'localhost' %>
- port: <%= ENV['SHAPACKER_DEV_SERVER_PORT'] || 3035 %>
+ host: <%= ENV['MY_SHAPACKER_DEV_SERVER_HOST'] || 'localhost' %>
+ port: <%= ENV['MY_SHAPACKER_DEV_SERVER_PORT'] || 3035 %>
# Hot Module Replacement updates modules while the application is running without a full reload
# Used instead of the `hot` key in https://webpack.js.org/configuration/dev-server/#devserverhot
hmr: true
diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml
index 54e5e8d19..2dadd0c1e 100644
--- a/docker-compose.dev.yml
+++ b/docker-compose.dev.yml
@@ -32,8 +32,8 @@ services:
interval: 30s
timeout: 10s
environment:
- - 'SHAKAPACKER_DEV_SERVER_HOST=webpacker'
- - 'SHAKAPACKER_DEV_SERVER_PORT=3035'
+ - 'MY_SHAKAPACKER_DEV_SERVER_HOST=webpacker'
+ - 'MY_SHAKAPACKER_DEV_SERVER_PORT=3035'
- 'THOR_SILENCE_DEPRECATION=true'
ports: # expose default rails port to host machine
- "3000:3000"
@@ -52,8 +52,8 @@ services:
condition: service_healthy
environment:
- 'NODE_ENV=development'
- - 'SHAKAPACKER_DEV_SERVER_HOST=webpacker'
- - 'SHAKAPACKER_DEV_SERVER_PORT=3035'
+ - 'MY_SHAKAPACKER_DEV_SERVER_HOST=webpacker'
+ - 'MY_SHAKAPACKER_DEV_SERVER_PORT=3035'
env_file: ./.env
volumes:
- 'homedir:/home/chemotion-dev/' |
Issue
this PR resolve the following issues when starting the wepack-dev-server
(to reproduce when using docker-compose.dev.yml comment out the env SHAPACKER_DEV_SERVER_HOST )
Changes
also rm 'SHAPACKER_DEV_SERVER_HOST' (and .. _PORT) as if it exists, it will anyway have precedence over the value set in the config.
rm devServer config from webpack/development.js as the whole block take precedence over the one in shakapacker.yml
add watchOptions to ensure node_modules are ignored to avoid the the limit error