Giter Site home page Giter Site logo

Comments (5)

afomera avatar afomera commented on July 28, 2024

This is fixed in the main branch from GitHub, it was due to a missing index.js file in the controllers folder, and the application.js calling import "controllers" after running the install script. This is the PR where the error was fixed: #34

a comment here #40 references that webpacker:install:stimulus is going to be removed (I guess it's gone in the 6.0 betas for webpack already).

from stimulus-rails.

noctivityinc avatar noctivityinc commented on July 28, 2024

from stimulus-rails.

afomera avatar afomera commented on July 28, 2024

I just ran it again on a fresh app too, and don't run into any problem. Can you post what the rails stimulus:install script outputs by chance?

Also double check that the gemfile has gem 'stimulus-rails', github: 'hotwired/stimulus-rails', branch: 'main' and you've bundled/restarted?

I got this output:

± rails stimulus:install
Appending Stimulus setup code to /Users/afomera/Projects/stimulus-test/app/javascript/packs/application.js
      append  app/javascript/packs/application.js
Creating controllers directory
      create  app/javascript/controllers
      create  app/javascript/controllers/hello_controller.js
      create  app/javascript/controllers/index.js
Installing all Stimulus dependencies
         run  yarn add stimulus from "."
yarn add v1.22.10
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
[3/4] 🔗  Linking dependencies...
warning " > [email protected]" has unmet peer dependency "webpack@^4.0.0 || ^5.0.0".
warning "webpack-dev-server > [email protected]" has unmet peer dependency "webpack@^4.0.0 || ^5.0.0".
[4/4] 🔨  Building fresh packages...
success Saved lockfile.
success Saved 5 new dependencies.
info Direct dependencies
└─ [email protected]
info All dependencies
├─ @stimulus/[email protected]
├─ @stimulus/[email protected]
├─ @stimulus/[email protected]
├─ @stimulus/[email protected]
└─ [email protected]
✨  Done in 4.43s.

Can follow the commits from a initial rails new here: https://github.com/afomera/trying-stimulus-rails/commits/main

I guess the last question if that all fails is what doesn't work? Unable to compile webpack? What kind of error do you see?

from stimulus-rails.

noctivityinc avatar noctivityinc commented on July 28, 2024

from stimulus-rails.

dixpac avatar dixpac commented on July 28, 2024

@noctivityinc , @dhh published latest 0.2.3 with the fix yesterday .
So I think we can close this one 😄

from stimulus-rails.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.