I've a problem when I configure for the first time the webpack.config.js in my Symfony 3.4 project. I folow the documentation of symfony to install and configure encore but I don't know why I've allways this error:
$ yarn run encore dev
yarn run v1.6.0
$ [my_root_project_path]\node_modules\.bin\encore dev
Running webpack ...
ERROR Failed to compile with 1 errors10:01:31
error
Entry module not found: Error: Can't resolve 'web/build/app.js' in '[my_root_project_path]'
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
my webpack.config.js file is this:
// webpack.config.js
var Encore = require('@symfony/webpack-encore');
Encore
.setOutputPath('web/build/')
.setPublicPath('/build')
.addEntry('app', 'web/build/app.js')
.autoProvidejQuery()
.enableSourceMaps(!Encore.isProduction())
.cleanupOutputBeforeBuild()
;
module.exports = Encore.getWebpackConfig();
Does the problem come from a permission on files that Encore doesn't? Anyway, I'm lost, I don't know what to do.
Config:
- Windows 10
- wamp server
- php version 5.6.31
- Symfony 3.4
- yarn 1.6.0
Note: I know there is probably another post of the same kind of issue but I think that at the moment I have tested everything and my problem persists. I'm always listening and if you think there's a stackoverflow post that can solve my problem I'll let you share it with me.