symfony / stimulus-bridge

Stimulus integration bridge for Symfony projects
https://symfony.com/ux
75 stars 15 forks source link

Error when installing stimulus 3 #52

Closed tacman closed 2 years ago

tacman commented 2 years ago

To reproduce:

symfony new --demo stim3 && cd stim3 
yarn add stimulus --dev && yarn run encore dev

Stimulus 3 installs, but yarn encore dev gives the unusual error:

success Saved 3 new dependencies.
info Direct dependencies
└─ stimulus@3.0.1
info All dependencies
├─ @hotwired/stimulus-webpack-helpers@1.0.1
├─ @hotwired/stimulus@3.0.1
└─ stimulus@3.0.1
Done in 4.69s.
yarn run v1.22.15
$ /home/tac/survos/stim3/node_modules/.bin/encore dev
Browserslist: caniuse-lite is outdated. Please run:
npx browserslist@latest --update-db

Why you should do it regularly:
https://github.com/browserslist/browserslist#browsers-data-updating
Running webpack ...

  Error: Install stimulus to use enableStimulusBridge()
    yarn add stimulus --dev

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Explicitly installing version 2 works okay.

stof commented 2 years ago

The work to upgrade to Stimulus 3 has started (see https://github.com/symfony/stimulus-bridge/pull/48 for the upgrade of the bridge, which is merged but not released yet).

weaverryan commented 2 years ago

Yup - we'll have it done soon - hopefully this week :)

johnnypea commented 2 years ago

@weaverryan any news, please?

weaverryan commented 2 years ago

Hopefully this week - everything is done - i'm just waiting on reviews/merges over on symfony/ux from @tgalopin (but it's a busy week with the conference).

tacman commented 2 years ago

Exciting to see the announcement about Stimulus 3 and stimulus bridge.

I must still have a version out of sync, though, because when I try and run encore, I get the following:

yarn encore dev
yarn run v1.22.15
warning ../package.json: No license field
$ /home/tac/survos/projects/bard/node_modules/.bin/encore dev
Running webpack ...

  Error: Install stimulus to use enableStimulusBridge()
    yarn add stimulus --dev

Obviously, that error message isn't right, it should be the new name now. I've tried reinstalling the recipe, updating all the libraries, etc., but I still can't see where the problem is.

tacman commented 2 years ago

Hmm, I got it to work, but I don't know how, lots of deleting and reinstalling.

tgalopin commented 2 years ago

This error probably comes from an outdated webpack-encore version, you probably got the newer version when reinstalling.

I think we can now close this PR, feel free to add a message here if there is still an issue.