The entry names between addEntry() and addStyleEntry() must be unique.
See original GitHub issueHi, I just moved to v0.14 and wanted to use the new Encore.configureFilenames()
method you added, here is the config I used:
Encore
.setOutputPath('web/assets/')
.setPublicPath('/assets')
.cleanupOutputBeforeBuild()
.configureFilenames({
css: 'css/[name]-[contenthash].css',
js: 'js/[name]-[chunkhash].js'
})
.addEntry('admin', './app/Resources/assets/js/admin.js')
.addEntry('main', './app/Resources/assets/js/main.js')
.addStyleEntry('admin', './app/Resources/assets/scss/admin.scss')
.addStyleEntry('main', './app/Resources/assets/scss/main.scss')
...
I thought it wouldn’t be a problem since JS and CSS files are compiled in different directories (the objective being to have a web/assets/js/admin.js
and a web/assets/css/admin.css
files), but I had this error:
Error: The "admin" passed to addStyleEntry() conflicts with a name passed to addEntry(). The entry names between addEntry() and addStyleEntry() must be unique.
Just wondering if that’s really causing a problem to have the same name, it’s not a really big problem to change it, I just found that weird!
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Duplicate name "app" passed to addEntry(): entries must be ...
The error message is clear Duplicate name "app" passed to addEntry(): entries must be unique.
Read more >Encore: Setting up your Project (Symfony Docs)
The key part is addEntry() : this tells Encore to load the assets/app.js file and follow all of the require() statements. It will...
Read more >Page-Specific JS: Multiple Entries > Webpack Encore
This contains some traditional JavaScript from a previous tutorial. ... Next, go into webpack.config.js and, up here, call addEntry() again. Name it ...
Read more >How to use the @symfony/webpack-encore.addEntry function ...
enableSassLoader() // allow sass/scss files to be processed .enableSourceMaps(!Encore.isProduction()) .cleanupOutputBeforeBuild() // empty the outputPath ...
Read more >First steps - Ibexa Developer Documentation
addStyleEntry() method) to your own Encore configuration for your project ... Input the Content Type's name, for example "Blog Post", and identifier: ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Another way to solve that is to avoid calling
addStyleEntry
and directly require CSS files from JS files.For instance:
@Sydney-o9 I don’t think there is something about it in the Symfony docs, but you can refer to the index.js file to see how to use it:
https://github.com/symfony/webpack-encore/blob/2684b7a907ed1351e5cd9439011cb811802af428/index.js#L680-L701