symfony / stimulus-bridge

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

Add explicit dependency on @babel/plugin-proposal-class-properties #6

Closed tgalopin closed 3 years ago

tgalopin commented 3 years ago

@weaverryan I'm not sure in which context I ended up without this module but I did in a project:

yarn dev
yarn run v1.22.5
warning ../../../package.json: No license field
$ encore dev
Running webpack ...

 ERROR  Failed to compile with 1 errors                                                                                                                                                                                    10:41:04 PM

 error  in ./assets/app.js

Syntax Error: Error: Cannot find module '@babel/plugin-proposal-class-properties' from '/home/tgalopin/Projects/citipo/marketing'
    at Array.map (<anonymous>)
    at cachedFunction.next (<anonymous>)
    at Generator.next (<anonymous>)
    at buildRootChain.next (<anonymous>)
    at loadPrivatePartialConfig.next (<anonymous>)
    at Generator.next (<anonymous>)
    at Generator.next (<anonymous>)
    at new Promise (<anonymous>)

Entrypoint app = runtime.js app.js
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Just to avoid that happening again, I propose to put the dependency as explicit. WDYT?

chapterjason commented 3 years ago

@tgalopin Just realized that you have this merged cause of the conflicts in #8

You just ended up with having a dependency in dev and runtime dependencies, that's not good. Also this is just a dev dependency cause of babel using this to transform class properties.

For me this looks like an issue with your project or maybe encore?

tgalopin commented 3 years ago

Good point, we should probably have it only as a direct dependency.