I followed the symfony documentation to enable webpack encore in my project: https://symfony.com/doc/5.1/frontend/encore/installation.html
Commands i issued:
> brew install node
> npm install -g yarn
> cd ~/path/to/project
> yarn set version berry
> composer require symfony/webpack-encore-bundle
> yarn install
They all ran through successfully, though yarn install
yielded some warnings about failing to build some packages.
When i executed yarn encore dev
afterwards i got following error:
ERROR Failed to compile with 1 errors 3:09:15 PM
error in ./assets/js/app.js
Syntax Error: Error: Cannot find module '@babel/plugin-syntax-dynamic-import' from '~/path/to/project'
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>)
Googling around has only led me to some github issues where the problem seemed to be related to the switch from babel 6 to 7, but as i did a fresh install that does not seem to be connected.
Additional Info:
- OS: macOS 10.15.6
- Node Version: v14.9.0