Webpacker: Cannot namespace packs

Created on 18 Apr 2017  路  7Comments  路  Source: rails/webpacker

app/javascript/packs/hello.js
<%= javascript_pack_tag 'hello' %>

works fine, but

app/javascript/packs/welcome/hello.js
<%= javascript_pack_tag 'welcome/hello' %>

produces:

Webpacker::FileLoader::NotFoundError in Welcome#index
Can't find welcome/hello.js in .../public/packs/manifest.json. Is webpack still compiling?

Even after restarting webpack-dev-server

Most helpful comment

It wasn't, updated the Gemfile to gem 'webpacker', github: "rails/webpacker" and it's working now!

Must've glossed over that suggestion in the readme, assuming I was on the latest version anyway

Thank you for your help @gauravtiwari

All 7 comments

@dino-k-29 Did you re-install webpacker after update? bundle exec rails webpacker:install - you will need to replace shared.js with the new one or copy the new changes.

Hi @gauravtiwari yes, I ran bundle exec rails webpacker:install as well as bundle exec rails webpacker:install:vue earlier and once again just now. Are there some additional steps to take regarding shared.js?

@dino-k-29 Did you run bundle update webpacker before that?

@gauravtiwari Just ran bundle update webpacker (set gem 'web-console', '3.3.0' in the process to avoid some kind of conflict with actionpack), then followed all the steps mentioned previously, but the same issue persists unfortunately

@dino-k-29 Right strange. One last thing, in your Gemfile webpacker is pinned to master right?

It wasn't, updated the Gemfile to gem 'webpacker', github: "rails/webpacker" and it's working now!

Must've glossed over that suggestion in the readme, assuming I was on the latest version anyway

Thank you for your help @gauravtiwari

Document this in README/Guide - #372

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ilrock picture ilrock  路  3Comments

itay-grudev picture itay-grudev  路  3Comments

johan-smits picture johan-smits  路  3Comments

christianrojas picture christianrojas  路  3Comments

FrankFang picture FrankFang  路  3Comments