-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Getting undefined method `javascript_pack_tag' for ... #172
Comments
It works on my side. I'm using rails Did you Not sure what error you got for webpack-dev-server, but if your port is blocked, you will encounter error like Let me know if the problem is resolved. |
@ytbryan Sure I run
Tutorial said it is for Rails 4.2+ and unfortunately due to dependency hell in my project I can't update to 5.1 yet :( |
I traced the gem source code
and it printed my debug, but still same error. Then I tried to use Helper manually and everything is fine.
|
May I know which rails version is this project on? |
@ytbryan |
Just tested it with |
Maybe some conflict gem? |
I don't have enough info to confirm that. Can you close this if the manual helped fixes it? Feel free to open it again if you find the root of the problem. |
Thanks |
@schovi Were you using .js.erb extension for app pack? |
If yes to above, do you got javascript comments in that file? Please remove that since it's erb. I have made a demo for you here - https://tranquil-inlet-61365.herokuapp.com/ and code is here - https://github.com/gauravtiwari/webpacker-demo-app |
@gauravtiwari I have bare structure generated by
works fine. |
Ah right, but it's bit strange too, given you are using Rails 5.0.1. It works without including helper for me - https://github.com/gauravtiwari/webpacker-demo-app. Perhaps, |
|
@schovi Could you please add |
When adding
This fixes it: module Webpacker
end
require 'webpacker/railtie' but still When I will have time, i will try to remove 3rd party gems one by one to find if there is conflict. |
@schovi I see. It's |
@gauravtiwari just typo, sorry. |
@schovi I am having the same issue, even after adding your snippet:
Did you find a solution to this? (that does not involve monkey-patching/manually defining |
@lbrito1 it was not solution. It was just experimenting with custom requiring. Snippet from before was workaround #172 (comment) |
I have the same error here with rails 5.0.1 and what solved to you didn't change here... |
I'm not sure why, but I found this problem was introduced when I included |
A generated Rails 5.1.rc1 with Here's the repo: https://github.com/archonic/limestone. My eternal gratitude if you can find what the issue is. Update: It's the strangest thing. I can insert a |
I ran into this issue, too, and in my app traced it to a |
@tylerhunt I have ActiveAdmin ofcourse. |
I've also run into this issue on rails 5.1.0.rc2 the project is using active admin but it doesn't use any |
Include webpacker helper to action view #172
Please could you all try latest master - |
Fixed, thanks! |
Don't forget to restart your server |
For prosperity: |
I ran into a similar issue when adding webpacker For me (and hopefully anyone reading this), the issue was caused by the js-style comment (as suggested earlier by another comment): // To reference this file, add <%= javascript_pack_tag 'application' %> to the appropriate
// layout file, like app/views/layouts/application.html.erb The solution is to make sure there is no |
I had this same problem. I just restarted my server and it worked. |
Поставил сервер, исправил косяк с запуском (решение нашел здесь - rails/webpacker#172 (comment)). Релаизовано: CRU (из CRUD) - Create, Read, Update.
I had to stop the server, then run But what has me curious is that I didn't need to start |
Having Rails 5 application and followed this tutorial https://medium.com/statuscode/introducing-webpacker-7136d66cddfb#.4xpiogt9l how to install and run webpacker.
Having webpacker in Gemfile
And used installation commands
And when open page with
<%= javascript_pack_tag 'app' %>
I am gettingundefined method 'javascript_pack_tag' for #<#<Class:0x007f8d5a158378>:0x007f8d5a0015b0>
./bin/webpack-dev-server runs fine (but having some babel errors, but I guess that can't have impact on previous error).
The text was updated successfully, but these errors were encountered: