Skip to content
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

Default to ERB for rails-erb-loader #220

Closed
wants to merge 1 commit into from
Closed

Default to ERB for rails-erb-loader #220

wants to merge 1 commit into from

Conversation

atwoodjw
Copy link

@atwoodjw atwoodjw commented Apr 2, 2017

Looks like rails-erb-loader has a default ERB template engine of erubis, not erb. This results in a build error on a freshly generated Rails 5.1.0.rc1 app.

https://github.com/usabilityhub/rails-erb-loader#options

ERROR in ./app/javascript/packs/sessions.js.erb
Module build failed: Error: Command failed: DISABLE_SPRING=1 bin/rails runner /Developer/testapp/node_modules/rails-erb-loader/erb_transformer.rb __RAILS_ERB_LOADER_DELIMETER__ erubis
/Users/testuser/.rvm/gems/ruby-2.3.1@testapp/gems/activesupport-5.1.0.rc1/lib/active_support/dependencies.rb:292:in `require': cannot load such file -- erubis (LoadError)

@renchap
Copy link
Contributor

renchap commented Apr 2, 2017

In Rails 5.1 the ERB engine switched to erubi (https://github.com/jeremyevans/erubi). Maybe it should be added as an engine in rails-erb-loader?

@rhys-vdw
Copy link

rhys-vdw commented Apr 2, 2017

Maybe it should be added as an engine in rails-erb-loader?

Alternatively, does Rails provide a generic interface to render an ERB template that is consistent between different versions? That way webpacker could default to a engine: "rails" option that would do the right thing for all versions.

@rhys-vdw
Copy link

rhys-vdw commented Apr 6, 2017

You can now update to rails-erb-loader version 5 to have erubi support and a default engine of erb.

@atwoodjw
Copy link
Author

atwoodjw commented Apr 6, 2017

Great. That makes this PR unnecessary. Closing.

@atwoodjw atwoodjw closed this Apr 6, 2017
@rhys-vdw
Copy link

rhys-vdw commented Apr 6, 2017

It would probably be appropriate to lock versions of npm dependencies of this project unless you want them to break with time. If you didn't have to change anything for this to work then that means you're vulnerable to unaddressed breaking changes.

Perhaps https://greenkeeper.io/ combined with a local package.json?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants