Skip to content

Error using configureFilenames and copyFiles #955

@tomhuhges

Description

@tomhuhges

encore config:

const Encore = require('@symfony/webpack-encore');

if (!Encore.isRuntimeEnvironmentConfigured()) {
    Encore.configureRuntimeEnvironment(process.env.NODE_ENV || 'dev');
}

Encore
    .setOutputPath('public/build/')
    .setPublicPath('/build')
    .addEntry('app', './assets/js/main.js')
    .splitEntryChunks()
    .enableSingleRuntimeChunk()
    .cleanupOutputBeforeBuild()
    .enableBuildNotifications()
    .enableSourceMaps(!Encore.isProduction())
    .enableVersioning(Encore.isProduction())
    .configureFilenames({
        js: `[name].[chunkhash].js`
    })
    .copyFiles([{
        from: 'assets/img',
        to: 'images/[path][name].[hash:8].[ext]',
        context: 'assets/img'
    }])
;

module.exports = Encore.getWebpackConfig();

i get this error:

[webpack-cli] HookWebpackError: Problem deleting JS entry for _tmp_copy: 0 files were deleted ()
at makeWebpackError (/Users/xxx/node_modules/webpack/lib/HookWebpackError.js:49:9)
    at /Users/xxx/node_modules/webpack/lib/Compilation.js:2383:12
    at eval (eval at create (/Users/xxx/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:64:1)
    at fn (/Users/xxx/node_modules/webpack/lib/Compilation.js:373:17)
    at Hook.eval [as callAsync] (eval at create (/Users/xxx/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:62:1)
    at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (/Users/xxx/node_modules/tapable/lib/Hook.js:18:14)
    at cont (/Users/xxx/lusa4/node_modules/webpack/lib/Compilation.js:2380:34)
    at /Users/xxx/node_modules/webpack/lib/Compilation.js:2426:10
    at /Users/xxx/node_modules/neo-async/async.js:2830:7
    at Object.each (/Users/xxx/node_modules/neo-async/async.js:2850:39)

deleting one of the configureFilenames or copyFiles configs runs the build successfully.
i'm using v 1.1.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions