Skip to content

Packs not being compiled on-demand in development environment #673

@speckins

Description

@speckins

According to the README, webpacker compiles on demand in the development environment:

In development, Webpacker compiles on demand rather than upfront by default. This happens when you refer to any of the pack assets using the Webpacker helper methods. That means you don't have to run any separate process. Compilation errors are logged to the standard Rails log.

In a new Rails 5.1.3 application generated with --webpack and with the following modifications:

app/views/layouts/application.html.erb
<%= javascript_pack_tag 'application' %>

config/routes.rb
root to: 'application#index'

app/views/application/index.html
Empty file

...I get the following error:

Webpacker::FileLoader::NotFoundError in Application#index
Can't find application.js in ~/rails513-webpack/public/packs/manifest.json. Is webpack still compiling?

After a manual invocation of "bin/rake webpacker:compile", the application.js pack loads without error but fails to update on-demand when app/javascript/packs/application.js is modified, as the documentation above would indicate it should.

(Tested on rails master - 5.2.0.alpha just now; same behavior. Also probably a duplicate of #671.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions