webpacker

Webpacker::Manifest::MissingEntryError in … localhost:3000/* errors

孤街浪徒 提交于 2019-12-23 04:28:29
问题 system: Ruby: ruby 2.6.5p114 (2019-10-01 revision 67812) [x86_64-linux] Rails: Rails 6.0.2 OS: Windows to a VM (vagrant ssh -> to ubuntu machine : Linux vagrant-ubuntu-trusty-64 3.13.0-170-generic #220-Ubuntu SMP x86_64 GNU/Linux when I run rails server -b 0.0.0.0 I can access localhost:3000 and see the Yay! You’re on Rails! but when I attempt to navigate to localhost:3000/say/hello the below error comes up in browser Browser error: Showing /files_on_your_computer/rails6tut/demo/app/views

Webpacker/Typescript can't resolve rails asset pipeline file

房东的猫 提交于 2019-12-13 03:49:29
问题 I'm trying to import a file that is in the rails asset pipeline and for some reason webpack can't find it. Here is my tsconfig.json: { "compilerOptions": { "declaration": false, "emitDecoratorMetadata": true, "experimentalDecorators": true, "lib": ["es6", "dom"], "module": "es6", "moduleResolution": "node", "sourceMap": true, "target": "es5", "baseUrl": ".", "paths": { "@images/*": ["app/assets/images/*"], } }, "exclude": [ "**/*.spec.ts", "node_modules", "vendor", "public" ], "compileOnSave"

Failed deploying rails app with webpacker to heroku

岁酱吖の 提交于 2019-12-13 03:24:33
问题 Environment Rails 5.1.5 webpack 3.11.0 Error message remote: Webpacker is installed 🎉 🍰 remote: Using /tmp/build_a60546bb726d2fa7f4b8b4ac052f461e/config/webpacker.yml file for setting up webpack paths remote: Compiling… remote: Compilation failed: remote: bundler: failed to load command: webpack (/tmp/build_a60546bb726d2fa7f4b8b4ac052f461e/vendor/bundle/ruby/2.3.0/bin/webpack) remote: Errno::ENOENT: No such file or directory - /tmp/build_a60546bb726d2fa7f4b8b4ac052f461e/node_modules/.bin

Insane loading time after adding Webpacker to Rails App

做~自己de王妃 提交于 2019-12-13 03:19:23
问题 I ran a Ruby on Rail's app, and everything was OK until I installed Webpacker. Now the loading time is between 180 000ms and 400 000ms, when I try to render any page. Removing the yield cause exacly the same problem. As I'm using Turbolinks I have a fast loading time when navigating in my app. I use Ruby 2.6.3, Rails 6.0.0.rc1. I installed Webpack via webpacker 4.0.7 gem, and Yarn, and then installed React. I ran ./bin/webpack-dev-server then launched rails server . Unfortunately, I haven't

Rails: Accessing JS module methods from files served by webpacker

ε祈祈猫儿з 提交于 2019-12-12 12:26:00
问题 Context I try to move assets in our application to webpack using Webpacker gem. Application is very big, so I need to do it partially. What did so far... I successfully managed to call the script using javascript_pack_tag I export a super simple module: # javascript/src/javascript/test.js' const Direction = { log_to_console: function(){ console.log('test'); } }; export default Direction; Then import it in the application entry point # javascript/packs/application.js import Test from '../src

Webpacker::Manifest::MissingEntryError in Home#index

怎甘沉沦 提交于 2019-12-11 17:41:25
问题 Webpacker::Manifest::MissingEntryError in Home#index Showing /Users/khalidhosein/Desktop/myEPKmedia/builder/khalid101/app/views/layouts/embedded_app.html.erb where line #7 raised: Webpacker can't find hello_react.js in /Users/khalidhosein/Desktop/myEPKmedia/builder/khalid101/public/packs/manifest.json. Possible causes: 1. You want to set webpacker.yml value of compile to true for your environment unless you are using the `webpack -w` or the webpack-dev-server. 2. webpack has not yet re-run to

Load fonts from node_modules in react-rails application with webpack

ぐ巨炮叔叔 提交于 2019-12-11 15:44:10
问题 I have a react-rails application set up with webpacker. I am trying to load font-awesome-pro with it's fonts from node_modules. I assume this is a trivial task but I can't seem to find any good documentation on how to do this. This is what I have so far: package.json dependencies: "dependencies": { "@rails/webpacker": "3.5", "babel-preset-react": "^6.24.1", "bootstrap": "^4.1.3", "prop-types": "^15.6.2", "react": "^16.5.2", "react-dom": "^16.5.2", "react-slick": "^0.23.1", "react_ujs": "^2.4

Webpacker requires Node.js >= v6.4 and you are using v5.4.0

别来无恙 提交于 2019-12-11 05:25:23
问题 I'm trying to install rails webpacker with the command: rails webpacker:install but i got the error: Webpacker requires Node.js >= v6.4 and you are using v5.4.0 But typing nodejs --version returns: v8.4.0 回答1: After 1h i just got my answer. The following command will do the trick: sudo ln -sf /usr/bin/nodejs /usr/local/bin/node Now it works 回答2: sudo ln -sf /usr/bin/nodejs /usr/local/bin/node The solution of Fabio Castaldi worked for me too. 来源: https://stackoverflow.com/questions/45844058

Rails + webpacker + vue: “You are using the runtime-only build of Vue where the template compiler is not available.”

巧了我就是萌 提交于 2019-12-10 12:34:48
问题 I've created a new rails 5.2 application and installed vue with: bundle exec rails webpacker:install:vue After creating a simple endpoint Home#landing and adding <%= javascript_pack_tag 'hello_vue' %> to the default layout the sample app is working as expected. I made a few changes: 1) Modified hello_vue.js to, import Vue from 'vue' document.addEventListener('DOMContentLoaded', () => { const app = new Vue({ el: '#vueapp', data: { message: "Hello Vue!" } }) }) 2) Created and empty <div id=

Pass data from Rails views to VueJS components in webpacker

荒凉一梦 提交于 2019-12-05 07:27:05
问题 I'm trying to fiddle with Rails 5.1's new webpacker gem, along with VueJS, but can't get my erb views to pass data to VueJS components... Let's say I have a user show view # view/users/show.html.erb <%= javascript_pack_tag "user-card" %> <%= content_tag :div, id: "user-card", data: { username: @user.name } do %> <% end %> And my javascript: // app/javascript/packs/user-card.js require("user-card") // app/javascript/user-card/index.js import Vue from 'vue/dist/vue.esm' import UserCard from '.