symfony / stimulus-bridge

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

Upgrade to Stimulus 3 - Webpack Encore is broken right now #49

Closed ThomasLandauer closed 2 years ago

ThomasLandauer commented 2 years ago

Foreword: I don't know what Stimulus is and why I need it ;-) I'm just following https://symfony.com/doc/current/frontend/encore/installation.html to install Webpack Encore.

$ yarn encore dev outputs:

Error: Install @symfony/stimulus-bridge & stimulus to use enableStimulusBridge() yarn add @symfony/stimulus-bridge@^2.0.0 stimulus --dev

$ yarn add @symfony/stimulus-bridge stimulus --dev

➤ YN0000: ┌ Resolution step ➤ YN0060: │ foo@workspace:. provides stimulus (pe425e) with version 3.0.1, which doesn't satisfy what @symfony/stimulus-bridge requests ➤ YN0000: │ Some peer dependencies are incorrectly met; run yarn explain peer-requirements for details, where is the six-letter p-prefixed code ➤ YN0000: └ Completed in 1s 911ms ➤ YN0000: ┌ Fetch step ➤ YN0013: │ @hotwired/stimulus-webpack-helpers@npm:1.0.1 can't be found in the cache and will be fetched from the remote registry ➤ YN0013: │ @hotwired/stimulus@npm:3.0.1 can't be found in the cache and will be fetched from the remote registry ➤ YN0013: │ @symfony/stimulus-bridge@npm:2.1.0 can't be found in the cache and will be fetched from the remote registry ➤ YN0013: │ stimulus@npm:3.0.1 can't be found in the cache and will be fetched from the remote registry ➤ YN0000: └ Completed in 1s 5ms ➤ YN0000: ┌ Link step ➤ YN0062: │ fsevents@patch:fsevents@npm%3A2.3.2#~builtin<compat/fsevents>::version=2.3.2&hash=1cc4b2 The platform linux is incompatible with this module, link skipped. ➤ YN0000: └ Completed in 0s 352ms ➤ YN0000: Done with warnings in 3s 399ms

$ yarn encore dev:

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

$ yarn add stimulus --dev:

Resolution step ➤ YN0060: │ foo@workspace:. provides stimulus (pe425e) with version 3.0.1, which doesn't satisfy what @symfony/stimulus-bridge requests ➤ YN0000: │ Some peer dependencies are incorrectly met; run yarn explain peer-requirements for details, where is the six-letter p-prefixed code ➤ YN0000: └ Completed ➤ YN0000: ┌ Fetch step ➤ YN0000: └ Completed in 0s 206ms ➤ YN0000: ┌ Link step ➤ YN0062: │ fsevents@patch:fsevents@npm%3A2.3.2#~builtin<compat/fsevents>::version=2.3.2&hash=1cc4b2 The platform linux is incompatible with this module, link skipped. ➤ YN0000: └ Completed in 0s 299ms ➤ YN0000: Done with warnings in 0s 750ms

$ yarn explain peer-requirements pe425e:

YN0000: foo@workspace:. provides stimulus@npm:3.0.1 with version 3.0.1, which doesn't satisfy the following requirements: ➤ YN0000: @symfony/stimulus-bridge@npm:2.1.0 [27b2e] → ^2.0 ✘

ThomasLandauer commented 2 years ago

Don't know if this is related, but after doing yarn add stimulus@^2.0 --dev, I'm now getting from yarn encore dev:

ERROR Failed to compile with 12 errors 18:47:34 Module build failed: Module not found: "./node_modules/@symfony/stimulus-bridge/lazy-controller-loader.js!./assets/controllers/hello_controller.js" contains a reference to the file "core-js/modules/es.object.set-prototype-of.js". This file can not be found, please check it for typos or update it if the file got moved. "./node_modules/@symfony/stimulus-bridge/lazy-controller-loader.js!./assets/controllers/hello_controller.js" contains a reference to the file "core-js/modules/es.object.get-prototype-of.js". This file can not be found, please check it for typos or update it if the file got moved. "./node_modules/@symfony/stimulus-bridge/lazy-controller-loader.js!./assets/controllers/hello_controller.js" contains a reference to the file "core-js/modules/es.reflect.construct.js". This file can not be found, please check it for typos or update it if the file got moved. "./node_modules/@symfony/stimulus-bridge/lazy-controller-loader.js!./assets/controllers/hello_controller.js" contains a reference to the file "core-js/modules/es.object.create.js". This file can not be found, please check it for typos or update it if the file got moved. "./node_modules/@symfony/stimulus-bridge/lazy-controller-loader.js!./assets/controllers/hello_controller.js" contains a reference to the file "core-js/modules/es.object.define-property.js". This file can not be found, please check it for typos or update it if the file got moved. "./node_modules/@symfony/stimulus-bridge/lazy-controller-loader.js!./assets/controllers/hello_controller.js" contains a reference to the file "core-js/modules/es.symbol.js". This file can not be found, please check it for typos or update it if the file got moved. "./node_modules/@symfony/stimulus-bridge/lazy-controller-loader.js!./assets/controllers/hello_controller.js" contains a reference to the file "core-js/modules/es.symbol.description.js". This file can not be found, please check it for typos or update it if the file got moved. "./node_modules/@symfony/stimulus-bridge/lazy-controller-loader.js!./assets/controllers/hello_controller.js" contains a reference to the file "core-js/modules/es.object.to-string.js". This file can not be found, please check it for typos or update it if the file got moved. "./node_modules/@symfony/stimulus-bridge/lazy-controller-loader.js!./assets/controllers/hello_controller.js" contains a reference to the file "core-js/modules/es.symbol.iterator.js". This file can not be found, please check it for typos or update it if the file got moved. "./node_modules/@symfony/stimulus-bridge/lazy-controller-loader.js!./assets/controllers/hello_controller.js" contains a reference to the file "core-js/modules/es.array.iterator.js". This file can not be found, please check it for typos or update it if the file got moved. "./node_modules/@symfony/stimulus-bridge/lazy-controller-loader.js!./assets/controllers/hello_controller.js" contains a reference to the file "core-js/modules/es.string.iterator.js". This file can not be found, please check it for typos or update it if the file got moved. "./node_modules/@symfony/stimulus-bridge/lazy-controller-loader.js!./assets/controllers/hello_controller.js" contains a reference to the file "core-js/modules/web.dom-collections.iterator.js". This file can not be found, please check it for typos or update it if the file got moved. Entrypoint app [big] 294 KiB = runtime.js 13 KiB vendors-node_modules_symfony_stimulus-bridge_dist_index_js.js 265 KiB app.css 406 bytes app.js 15.5 KiB webpack compiled with 12 errors

Dannebicque commented 2 years ago

Hi, I have the same issue.

I have always the message yarn add stimulus --dev But Stimulus is correctly installed.

Thanks for your help

graceman9 commented 2 years ago

@ThomasLandauer see https://github.com/symfony/stimulus-bridge/issues/47#issuecomment-900506354

weaverryan commented 2 years ago

Closing. There are 2 issues here: (1) we don't yet support Stimulus 3 (we will soon - the work is all done). (2) about the core-js, I'll comment on #47 :)

MichaelMackus commented 2 years ago

Same. Just following the symfony instructions don't work currently.

allartdo commented 1 year ago

What just fixed it for me was doing yarn install again. I got this error in the first place because I upgraded from Symfony 5.3 to 5.4. After that I upgraded my recipes. When upgrading webpack recipe I got the error after running yarn encore dev. After a yarn install everything worked as expected.