DEV Community

Discussion on: Rails 7, Bootstrap 5 and importmaps without nodejs

Collapse
 
skrobul profile image
Marek Skrobacki

Don't think this really "works without node" - bootstrap gem does not work if there is no execjs runtime (just try removing executable permission from your NodeJS installation on the system) because autoprefixer needs it. Is there some magic way to force it to use something else?

Collapse
 
coorasse profile image
Alessandro Rodi

Good point! Yes, you can also use another runtime: github.com/ai/autoprefixer-rails#u...

Collapse
 
kisp_1 profile image
Kilian Sprotte

I am also running into this problem with execjs.

I was hoping to set things up so that node is only needed in development, but not in production.

I would then have a two-stage Dockerfile where the assets precompile run is done with node present, but then node should not be needed.

Unfortunately, the execjs error about missing node prevents me from opening a rails console or running db:migrate.

I haven't managed to make this work using groups or require: false in my Gemfile.