Skip to content

rails generate react:install after webpacker react install runs incorrect insertions #755

@lasernite

Description

@lasernite

Help us help you! Please choose one:

  • My app doesn't crash, but I'm getting unexpected behavior. So, I've described the unexpected behavior and suggested a new behavior.

After running

$ rails webpacker:install
$ rails webpacker:install:react
$ rails generate react:install

The following is executed

create  app/assets/javascripts/components
create  app/assets/javascripts/components/.gitkeep
insert  app/assets/javascripts/application.js
insert  app/assets/javascripts/application.js
insert  app/assets/javascripts/application.js
create  app/assets/javascripts/components.js

But I am under the impression that a ReactRailsUJS setup in packs/application.js should occur.

I had originally installed react-rails first, before webpacker, which may be why this is happening. But as far as I can tell I deleted all the files and removed the assets/javascripts/application.js references before running them in order, so I'm not sure why this is happening unless there is a hidden config somewhere. Also, without digging through the gem if you could let me know what needs to be in the app/javascript/application.js to configure manually, that would be appreciated. Thanks.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions