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.
811
questions
0
votes
0
answers
24
views
rails/webpacker module build fail issue from ./node_modules/mini-css-extract-plugin/dist/loader.js
I have upgraded @rails/webpacker from v4 to v5 (5.72.1, to be precise). While upgrading, I got following issue
ERROR in ./node_modules/croppie/croppie.css Module build failed (from
./node_modules/@...
-1
votes
1
answer
23
views
out of no where, suddenly getting __webpack_require__.h is not a function
My app was working fine... Attempted to run my feature specs using capybara with chrome (apparition driver), and I got: Failed to compile webpack!
I then launched my app in the browser, which was ...
1
vote
1
answer
193
views
Uncaught (in promise) CompileError: WebAssembly.instantiate(): expected magic word 00 61 73 6d, found 3c 21 44 4f @+0
I am getting the following error while running my Ruby on rails 6 app on locale (Ubuntu 18.04 using chrome):
Uncaught (CardanoSerializationLib.ts:15 in promise) CompileError: WebAssembly.instantiate()...
0
votes
0
answers
16
views
rails 6 nginx passenger setup webpacker
I am trying to deploy rails app with nginx & passenger. I have set up everything.
Now when I try to run my application, I get following error in production,
ActionView::Template::Error (Webpacker ...
0
votes
0
answers
53
views
Can I install Importmap or JS/CSS Bundling alongside Webpacker on Rails 6?
Looking to potentially install Importmap or JS/CSS Bundling alongside my existing Webpacker installation in my Rails 6 app. The idea is to test and migrate existing UI code over ahead of a Rails 7 ...
0
votes
1
answer
82
views
Docker Buildx missing files in building arm 64 rails image
I am trying to build a arm64 image on a x64 linux os. The 64 bit version using docker build . ... works perfectly. On the docker buildx version though, I am missing several configuration files causing ...
0
votes
2
answers
429
views
undefined method `javascript_pack_tag' for #<ActionView::Base:0x0000000000a730>
I am currently working with webpacker currently shakapacker. The structure of my generated app using rails new react-app --webpack=reactis app/javascript/application.js and not as shown below
I have ...
0
votes
1
answer
79
views
How to connect alpinejs code and custom javascript file in rails
This Question might sound stupid. But i am learning alpine while implementing it with rails.
The problem is i am getting this error
alpine.js:1914 Uncaught ReferenceError: carouselData is not defined
...
0
votes
1
answer
48
views
How to make Webpacker compiling instantly in my Rails project?
When I start my server with docker-compose up rails command, there is shows a [Webpacker] Compiling... which goes for about a ten seconds and then it gives this output
rails_1 | [Webpacker] ...
0
votes
0
answers
33
views
Checking webpacker is cause of for time sink
Working on a ruby on rails application.
Let's say I make a small change to any class file and make a request to some page on my application. Then my response times are increased by anywhere from 20 ...
0
votes
0
answers
22
views
Ruby on Rails project not compilation assets without show errors, Heroku
Preparing app for Rails asset pipeline
Running: rake assets:precompile
yarn install v1.22.17
[1/5] Validating package.json...
[2/5] Resolving packages...
[3/5] Fetching packages...
[...
0
votes
0
answers
14
views
Heroku styling appears different then styling in development (localhost)
I have deployed my website to heroku and the styling shows up different then the styling that I have on localhost (possiblity: some stylesheets are not compiling). I have tried precompiling assets. I ...
0
votes
2
answers
544
views
Webpacker can't find application.js in /app/public/packs/manifest.json and I can't precompile assets after deleting node_modules folder
I am using Ruby 2.7.1, Rails 5.2, Webpacker 5.4.3. I have just installed Stimulus and Webpacker to add a bit of functionality.
I'm only using scss and not via webpacker. All I have added webpacker for ...
1
vote
0
answers
29
views
Rails 6 webpacker problem importing magnific-popup package
Im using rails 6 and webpacker.
Im trying to use a js lib called magnific popup.
yarn add magnific-popup
It relies on jquery so I added to my environment.js :
const { environment } = require('@rails/...
0
votes
0
answers
7
views
Error when using server side rendered component with react_on_rails
I am getting:
No such file or directory @ rb_file_s_mtime - http://localhost:3000/packs/server-bundle-0eafa1dd25831321c1bd.js
on my localhosot with foreman start -f Procfile.dev with a SSR component ...
0
votes
2
answers
196
views
shakapacker: Webpacker can't find subdir/image.png in manifest.json
I am trying to upgrade my app to Rails 7 and decided to upgrade shakapacker (aka webpacker 6).
I like to have images in app/javascript/images organized into subdirectories but for some reason this ...
0
votes
0
answers
16
views
SCSS files organization using Webpacker
I'm wondering how to organize SCSS files using Webpacker. Here is my file structure with which I've no issue in development:
app/javascript/stylesheets/
├── application.scss
├── customs
│ ├── ...
0
votes
0
answers
20
views
Why disabling optimization is not working?
I have an issue of Minified React error #130 at production, it works normally at development, but I have no idea what's at production.
I tried to disable the optimization, but it did not work, here is ...
0
votes
1
answer
146
views
ParserError: Syntax Error at line: 1, column 25 - Error compiling sass only when deploying to production or running CI
I am failing to see what is the reason for the compilation error.
Also, it is worth noting that I can run my app locally. ./bin/webpack-dev-server works just fine. Running tests locally also work.
I ...
0
votes
0
answers
24
views
Rails 6.1 How to manage include multiple js files into a single pack
I'm trying to migrate a Rails 4.2 app to Rails 6.1 for a client. Simplest approach was to just create a Rails 6.1 app then move the code over bit by bit adjusting as needed.
However, I'm run into an ...
1
vote
0
answers
15
views
Sharetribe installation rake aborted
When trying to install sharetribe, and following the procedure, I type :
bundle exec rake db:create db:structure:load
rake aborted!
NameError: uninitialized constant ReactOnRails::WebpackerUtils::...
0
votes
1
answer
82
views
React-rails Cannot Find App Component in View
Finally after many steps of troubleshooting rails is rendering our NavBar component, but not the base App component where everything is imported. Wondering what I might need to consider if there's a ...
0
votes
0
answers
64
views
Can't run yarn install smoothly, getting sketchy errors instead
This is happening to me after a git rebase.
The following error shows up after:
running yarn upgrade having a yarn.lock file
Also executing yarn install after deleting yarn.lock
when trying to add a ...
0
votes
0
answers
107
views
Can't Heroku push, failed to compile Rails
I have tried many times to git push heroku master my testing app and i always run to the same issue. I have been over many solutions from heroku push rejected, failed to compile Ruby app but none ...
0
votes
0
answers
30
views
ENV vars with react-rails
I have added dotenv with yarn add dotenv and I added this piece of code on config/webpack/development.js
const dotenv = require('dotenv')
dotenv.config()
I have added a file in the root directory ....
0
votes
0
answers
36
views
Adding to Webpacker generated manifest.json
I have a node_module (node_modules/@my_module) which has precompiled JS & CSS files (node_modules/@my_module/src/my_file.js etc.) that I want to include in the available JS in the autogenerated ...
0
votes
1
answer
52
views
Webpacker fails to compile React code: Invalid configuration object
I'm trying to update a working Rails 5/React app (used webpack through npm) to Rails 6. I did this by starting creating a new rails app with webpacker=rails so that (in theory) it would make things ...
1
vote
0
answers
35
views
Implementation of handlebars-loader in rails app
In my rails app I try to use handlebars. Some code is from this tutorial (https://medium.com/@jphager2/adding-handlebars-to-a-rails-app-with-webpacker-d246c58e0c38) some from the webpacker docs.
I did
...
1
vote
0
answers
95
views
Webpacker/babel issue - can't load Uppy
I have pretty fresh rails application and I'm trying to add uppy file uploader to it. Unfortunately when requiring @uppy/core file I am presented with Cannot assign to read only property 'exports' of ...
0
votes
2
answers
142
views
Unable to Add React to existing Rails app
I've setup a rails app all good, server runs fine etc, now I need to add React to it.
I see the command
rails webpack:install:react
appears to be the way everyone recommends but when I run this I get ...
1
vote
1
answer
132
views
Invalid configuration object: webpack-cli configuration.optimization.splitChunks Webpacker 5 Rails 6
After upgrading from Webpacker 4 to 5, I receive a new error while running rails webpacker:compile. Running yarn dev, alone; works without issue -- I can't seem to find what the cause of this bug is, ...
0
votes
0
answers
132
views
Webpacker css-loader error Unclosed string in sass files with quotes (' or ")
Problem Statement
I'm trying to migrate a monolithic ruby on rails app from sprockets to webpacker, I have some sass and scss files as part of the styles so when I imported those using webpacker and ...
0
votes
0
answers
15
views
No Driver package loaded message in google chrome webpack
I am trying to automate a website using UiPath but I am getting the below message and not able to communicate with chrome. #webpack
[OnContentScriptLoadRequest] No Driver package loaded
Any idea why ...
1
vote
0
answers
84
views
How to import sortablejs properly with webpacker?
I am trying to import sortablejs by using webpacker gem in rails, but no luck so far.
With these settings I get error Sortable is not defined.
Imported it like this in javascript/packs/application.js
...
0
votes
0
answers
127
views
Sweetalert2 and Rails 6 Module build failed (from ./node_modules/sass-loader/dist/cjs.js)
I have the version of Rails 6.0.3. I installed sweetalert2 via the yarn command:
yarn add sweetalert2
Then I added in app/javascript/packs/application.js:
import Swal from 'sweetalert2/dist/...
0
votes
0
answers
17
views
Can't avoid my jest tests to be compiled for deploy in my react-rails app
I work in a rails application which uses React for front-end with gems webpacker 5 and react-rails.
I configured my application to run tests with Jest in my React components and, tests are being also ...
1
vote
0
answers
80
views
How to address several javascript_pack_tag's when having at least one namespace in routes file in rails
In my routes I have something like:
...
namespace :backend do
...
end
...
Now
I have to use two different 'ApplicationControllers' as entry point for my root application route and my backed ...
0
votes
0
answers
360
views
Rails 6: Webpacker::Manifest::MissingEntryError in Home#index
OS: Manjaro
Webpacker can't find application.js in /run/media/wowvain/Software/Work/Ruby-on-Rails/blog/public/packs/manifest.json. Possible causes:
1. You want to set webpacker.yml value of compile ...
0
votes
1
answer
57
views
Routing Error No route matches [GET] "/logout" after cloning directory
I get this error message when I try to log out in my rails app:
Routing Error
No route matches [GET] "/logout"
I have a route that directs to log out in my routes.rb
delete '/logout', to: '...
5
votes
3
answers
548
views
How to Install Alpine JS 3 with Rails 6.1 via Webpacker
Ever since AlpineJS upgraded to Alpine 3, I haven't been able to get it working with Rails 6 and webpacker, I've only been able to get it working when linking to the CDN version of Alpine.
In the past ...
-1
votes
1
answer
156
views
Rails 6 with Webpacker & SCSS not working
I am having two separate issues (or maybe they are combined and I'm missing it). The app was picking up the bootstrap styles, but is no longer doing so.
Issue 1
When I make any updates to application....
1
vote
1
answer
132
views
Webpacker compiles successfully but no output files
I am running webpacker-dev-server inside a docker container.
The problem I am facing is that I cannot find anywhere on the system the assets compiled by webpacker.
Webpacker outputs the following ...
1
vote
0
answers
330
views
Rails 6 [Webpacker] Compiling... takes longs time in development enviroment
Webpacker (5.1.1) with Rails 6.1.4 takes a long time while compiling css and js files for existing project and extremely very slow.
[Web packer] Compiling...
Environments: Ruby 2.7.2, Node(v14.15.5), ...
2
votes
1
answer
205
views
Rails 6 & Webpacker 5 set custom path for node_modules
I am using Rails 6 in a VirtualBox virtual machine through Vagrant.
Vagrant mounts shared folder (with project) from the host system (Windows) to the Ubuntu 20LTS virtual machine.
And it happens that ...
0
votes
0
answers
42
views
Rails 6 webpacker can't find styles
I deployed Rails 6.0 app to Heroku. The build was successful and deployment was successful, the server started but I get an error:
ActionView::Template::Error (Webpacker can't find styles.css in /app/...
0
votes
0
answers
165
views
Rails Webpacker not rendering CSS, console error 'Cannot read property 'tap' of undefined' at ExternalModuleFactoryPlugin.apply
I'm upgrading a somewhat neglected Rails app, and am running into the following error
ERROR in ./resources/assets/styles/index.scss
Module build failed (from ./node_modules/@rails/webpacker/...
2
votes
0
answers
47
views
import statements in webpack 5 seem to wrap everything in module.exports = ""
I recently upgraded from webpack 4 to webpack 5 along with rails webpacker 6.0.0.rc5 and am finding that before, doing something like:
import template from 'template.html'
the template variable would ...
1
vote
1
answer
659
views
webpacker 5.x can't compile Angular 13 application
After following exactly, step by step installation instructions from the https://github.com/rails/webpacker/tree/5-x-stable page I got following compilation error:
Compiling...
Compilation failed:
...
0
votes
1
answer
48
views
Issue loading jQuery in Webpacker 5
I'm trying to add jQuery as a Webpacker/Webpack (5.4.3) plugin to my Rails (6.0.4.1) app, but I keep getting a "jQuery is not defined error." I'm using the following code, which seems to be ...
0
votes
0
answers
51
views
Using Ruby On Rails assets path with Webpacker for Angular templates
Just wondering if there is any way to use Ruby on Rails assets pipeline helpers like image_tag within Angular views. There is ROR application, which uses Webpack (latest) and Angular (latest). I'd ...