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
0
votes
1 answer

In Rails with Webpacker app, compiled styles appear to load ok (200), but aren't applied

Upgrading an existing React project from Rails 4 to 5.1 and loading assets with the new Webpacker pack_tag system. Things seem to compile correctly, I've got a pack file packs/mutts.jsx and in my index.html.erb I reference with <%=…
DangerAle
  • 31
  • 5
0
votes
2 answers

Maintain the State separate in 2 different items from the same array in React

I have just graduated a bootcamp and working on my first project in React. I have a fetch request that renders back an array of objects from my Rails DB. They are books. And each book has specific reviews. I therefore have all my books rendered in…
Corina Feraru
  • 39
  • 2
  • 8
0
votes
1 answer

After adding yarn and webpacker several errors in precompilation

I recently added webpacker and yarn to a rails 5 application and executed bundle exec webpacker:install:react. This installed a plenty of dependency and I getting the several errors while running bundle exec rake assets:precompile…
mabe02
  • 2,676
  • 2
  • 20
  • 35
0
votes
1 answer

Rails 5: loading static assets from a yarn package

I'm currently using vue2-dropzone for a Rails 5 project. I've installed it with yarn add vue2-dropzone. The package includes its styles from the rollup.config.js file, as such: export default { moduleName: 'vue2Dropzone', entry: 'src/index.js', …
DaniG2k
  • 4,772
  • 36
  • 77
0
votes
2 answers

render: function - JSX failed to compilie with SyntaxError Unexpected token - Rails 5.1 Webpack Reactjs

I'm having an issue running a React component as I get a Syntax Error: Failed to compile. ./app/javascript/RoastsJson/index.jsx Module build failed: SyntaxError: Unexpected token (6:10) 4 | class RoastsJson extends React.Component { 5 | > 6…
Simon Cooper
  • 1,574
  • 4
  • 24
  • 53
0
votes
1 answer

node version on $PATH issue on mac

Having problems when trying to push my Rails 5.1 app to Heroku. rake:assets:precompile fails with Webpacker requires Node.js >= 6.0.0 and you are using 0.10.30 I've posted before on this but haven't been able to resolve it, and am now going round…
Simon Cooper
  • 1,574
  • 4
  • 24
  • 53
0
votes
1 answer

` Unexpected token 'const'` webpack and babel not transpiling code in WEBPACK VAR INJECTION section

We have a Rails 5 project that uses react_on_rails, and thus webpack (via the webpacker gem) and babel. We are running testing using capybara webkit and we are getting this error when using the webkit_debug javascript…
DaKaZ
  • 925
  • 1
  • 7
  • 18
0
votes
2 answers

Rails Webpacker internal assets aren't proxied to action_controller.asset_host

I am using Rails 5.1 and Webpacker. It all works fine. I am using images inside my react components that are in /app/javascripts/images, and I import them fine into my components and all is well on development. However - when I deploy, the internal…
Joerg
  • 3,553
  • 4
  • 32
  • 41
0
votes
1 answer

Getting errors in Rails asset:pipeline with Webpacker and Heroku

I have a Rails 5.1.4 app that I inherited that is deployed to Heroku. It is using webpacker with vuejs and am now having problems deploying to Heroku. I am getting the following message when Heroku run rake assets:precompile: remote: [13]…
timpone
  • 19,235
  • 36
  • 121
  • 211
0
votes
1 answer

different md5 fingerprint for identical files

I've got two servers... When deploying to them, they each call bundle exec rake assets:precompile. The result is two totally different md5 fingerprints for identical files: from server 1: -rw-r--r-- 1 me 867345376 975106 Nov 30 10:22…
patrick
  • 9,290
  • 13
  • 61
  • 112
0
votes
1 answer

webpacker not working correctly on heroku

I'm in the middle of upgrading an app from rails 3.2 to rails 4.2 using webpacker gem everything works fine in localhost I have compiled my assets and run RAILS_ENV=production rails s but I have errors when pushing to heroku it compiles all…
Boris Barroso
  • 1,802
  • 2
  • 22
  • 41
0
votes
1 answer

WebStorm + webpacker debugging

Hello StackOverflow community! My team is working on a ruby on rails project, where some parts are written in react. We are using webpacker gem to bundle js files into packs. I'm trying to set up WebStorm to work with our project, but I have…
0
votes
0 answers

Using old JavaScript files with webpack, what is the ES6 way?

I have used the react-rails gem for a while. While using it, I placed my ES6 components under app/assets/javascript/components folder and placed plain old JavaScript files to app/assets/javascript. The good thing was I was able to easily refer the…
Mehmet Kaplan
  • 1,723
  • 2
  • 20
  • 43
0
votes
1 answer

how can I load images in base64 string by url-loader in typescript + react (rails5 + webpacker)

example repo https://github.com/github0013/typescript_react I need to load images in base64 string embeded into tag, but importing image files will raise this error. TS2307: Cannot find module…
kukrt
  • 2,117
  • 3
  • 21
  • 32
0
votes
1 answer

Rails 5.1 api webpacker and vuejs

I'm trying to create a Rails API and a client in VueJs using webpacker on Cloud9. After a standard installation : npm install -g yarn && rails _5.1.4_ new . --api --webpack=vue I'm using Foreman to launch rails and webpack, here is the file. #…
Alain ANDRE
  • 305
  • 1
  • 13