webpack-encore: Example giving in documentation does not work on windows
When following the first example in documentation you will end up with this error on windows
Error: Cannot determine how to prefix the keys in manifest.json. Call Encore.setManifestKeyPrefix() to choose what path (e.g. build/) to use when building your manifest keys. This is caused by setOutpu tPath() and setPublicPath() containing paths that don’t seem compatible.
This is reproduce able by creating an empty directory and following:
- execute
$ yarn add @symfony/webpack-encore --dev
- create
webpack.config.js
file with contents found on http://symfony.com/doc/current/frontend/encore/simple-example.html - creating
assets/js/main.js
&assets/css/global.scss
- execute
./node_modules/.bin/encore dev
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 18 (5 by maintainers)
Temporary fix for Windows environment:
At least this one is worked for me. @DaRamirezSoto Can you confirm, that this workaround is ok?
@Alestaan Hi,
I am executing this command:
@Alestaan Try
npm
instead ofyarn
@vdjagilev Hi,
Oh i see now … so i shouldn’t use the
yarn run encore dev
command right ?But shouldn’t the yarn run command be supported for the watch ? (i’m just asking, i’m curious about it)
Anyway, thanks !!
This makes sense - some of the path comparisons are certainly choking on the
\
paths from Windows. We need to setup appveyor (it should be activated, but we don’t have any config for it yet). That should show us the errors and they’ll be easy to fix 😃.