Questions tagged [webpacker]

Webpacker is a Ruby gem for Ruby on Rails that makes it easy to use Webpack, the JavaScript module bundler, to manage application-like JavaScript in Rails. It coexists with the asset pipeline and can even replace it by processing CSS, images, fonts, and more.

Features

License

MIT

Links

GitHub

RubyGems

817 questions
11
votes
1 answer

Rails + Webpacker + React.js / Cannot find module

I'm learning React.js with Rails 4.2 (to prepare to work on it) but I have a lot of errors in my console. So I'm using React 16.8 (with react-rails gem) + Rails 4.2 + Webpacker 4.0.2 My folders structure: app | javascript | packs | …
cercxtrova
  • 1,555
  • 13
  • 30
11
votes
1 answer

Rails Webpacker 3.0 import CSS file is not working

I am working Rails5 project with Webpacker in order to run React properly But when import my css file inside my root component seems it is not working at all. Looking like stylesheet is not coming at all. This is my root Component import React from…
Varis Darasirikul
  • 3,907
  • 9
  • 40
  • 75
10
votes
3 answers

Compiling js via webpacker results in: SassError: expected "{"

I'm trying to use scss in my rails application, configured by webpacker. Whenever I run rails webpacker:compile, I get the following error: ERROR in ./app/javascript/stylesheets/application.scss Module build failed (from…
Kurt Mueller
  • 3,173
  • 2
  • 29
  • 50
10
votes
1 answer

Webpacker error related to module babel-plugin-syntax-dynamic-import

Getting an error trying to load a page. Rails 6, Ruby 2.7.1. Webpacker for javascript and SCSS From the Terminal (similar to the Chrome Console error ) Module build failed (from ./node_modules/babel-loader/lib/index.js): Error: Cannot find module…
Greg
  • 2,359
  • 5
  • 22
  • 35
10
votes
2 answers

Getting Jquery and Bootstrap to work with Rails 6

I am a new to rails and struggling to get Jquery and Bootstrap to work with Rails 6. I think it has something to do with switching the app from rails 5 to rails 6 and using webpacker to load Jquery rather than loading it as a gem. I have gone…
10
votes
1 answer

Importing CSS with webpacker in Rails 6

I use webpacker with Rails and am installing taildwindcss right now. Their installation guide says to use an @import method if I'm using postcss-import. I must say I get confused whenever I have to import CSS to Rails with webpacker, so I have a few…
sloneorzeszki
  • 1,274
  • 3
  • 12
  • 22
10
votes
1 answer

Rails 6 local server booting : RAILS_ENV=development environment is not defined

I just created a new Rails 6 app. Everything went fine until I tried to launch the local server with rails s, and got this error message : RAILS_ENV=development environment is not defined in config/webpacker.yml, falling back to production…
Ruff9
  • 1,163
  • 15
  • 34
10
votes
1 answer

Rails 5.1+ Vuejs Webpacker: Normal Rails MVC vs Rails API

I am starting a new app using Rails 5.1 and Vue.js, with the built-in Webpacker Vue.js pack (generated via the --webpack=vue flag). I am trying to understand the pros & cons of using a normal Rails MVC app vs a Rails API app (generating a Rails…
Kobi
  • 4,003
  • 4
  • 18
  • 23
9
votes
1 answer

Webpacker: The resolved_paths option has been deprecated. Use additional_paths instead

I bumped webpacker from 4.x to 5.2.1 and started getting this warning: The resolved_paths option has been deprecated. Use additional_paths instead. This seems straightforward enough, my config/webpacker.yml was almost unmodified: # Additional…
Dave Slutzkin
  • 1,592
  • 14
  • 19
9
votes
1 answer

How do I load local fonts with @rails/webpacker?

I’m having an issue loading local font files with @rails/webpacker. The fonts are loaded in the development environment but not in the production environment. It seems like a really simple issue but I have just had so much trouble with it. Below is…
einar_j
  • 141
  • 1
  • 4
9
votes
8 answers

Rails 6: How to add jquery-ui through webpacker?

I'm currently trying to implement a datepicker into my application, the problem is that there is no documentation on how to add the jquery-ui-rails gem through webpacker. Probably there is another way to add gems or another gem that would fit my…
arnasklas
  • 123
  • 1
  • 1
  • 5
9
votes
1 answer

Webpacker not compiling live

I have my Rails apps running and have Webpacker installed. I have the webpack-dev-server running as a Docker container but it doesn;t seem to be responding to changes in my files and recompiling. Can anyone check my config to see if they can spot…
rctneil
  • 7,016
  • 10
  • 40
  • 83
9
votes
2 answers

How to import **/* glob scss in Rails with webpacker

I'm using a Rails 5.2 app and have an application.scss file filled with individual imports @import '../stylesheets/pages/home'; @import '../stylesheets/pages/product_details'; @import '../stylesheets/pages/cart'; @import…
Jack Kinsella
  • 4,491
  • 3
  • 38
  • 56
8
votes
1 answer

Error: Cannot find module '@rails/webpacker' rails 6

When I run my Rails 6.0 application on development environment I get the next trace on the development.log [Webpacker] Compiling… [Webpacker] Compilation failed: /home/alejo/rails_project/node_modules/webpack-cli/bin/cli.js:93 throw…
Alejo Dev
  • 2,290
  • 4
  • 29
  • 45
8
votes
4 answers

Rails 6 and Tailwind CSS does not deploy to Heroku

I have a Rails 6 app that was successfully deployed to Heroku and worked on localhost:3000. I added tailwindcss via yarn and webpack. It runs perfectly fine on localhost, but does not run on heroku. When I run heroku logs I get the following…
David Lee
  • 571
  • 6
  • 20
1 2
3
54 55