-
-
Notifications
You must be signed in to change notification settings - Fork 199
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
copyFiles() error after 1.0 upgrade #894
Comments
I'll have to check into this - but it sounds legitimate. Webpack 5 (and Encore 1.0) uses the new "Asset Modules", which basically means: there are some differences in how images are handled. But yes, this behavior is odd - why the images would copy correctly in one spot but not another... |
Same problem here. Details below. package.json {
"devDependencies": {
"@babel/preset-react": "^7.0.0",
"@symfony/stimulus-bridge": "^1.1.0",
"@symfony/webpack-encore": "^1.0.0",
"core-js": "^3.0.0",
"file-loader": "^6.0.0",
"regenerator-runtime": "^0.13.2",
"sass": "^1.32.5",
"sass-loader": "^10.0.0",
"stimulus": "^2.0.0",
"webpack-notifier": "^1.6.0"
},
// ...
"dependencies": {
"ckeditor": "^4.12.1",
// ...
}
} webpack.config.js .copyFiles([
// ...
{from: './node_modules/ckeditor/plugins', to: 'ckeditor/plugins/[path][name].[ext]'},
{from: './node_modules/ckeditor/skins', to: 'ckeditor/skins/[path][name].[ext]'}
]) Running
The error It appeared after upgrade "devDependencies": {
"@babel/plugin-proposal-class-properties": "^7.8.3",
"@babel/preset-react": "^7.0.0",
"@symfony/webpack-encore": "^0.27.0",
"core-js": "^3.0.0",
"node-sass": "^4.12.0",
"sass-loader": "^7.0.1",
"webpack-notifier": "^1.6.0"
}, with: "devDependencies": {
"@babel/preset-react": "^7.0.0",
"@symfony/stimulus-bridge": "^1.1.0",
"@symfony/webpack-encore": "^1.0.0",
"core-js": "^3.0.0",
"file-loader": "^6.0.0",
"regenerator-runtime": "^0.13.2",
"sass": "^1.32.5",
"sass-loader": "^10.0.0",
"stimulus": "^2.0.0",
"webpack-notifier": "^1.6.0"
}, in I was trying different solutions, like change: .copyFiles([
// ...
{from: './node_modules/ckeditor/plugins', to: 'ckeditor/plugins/[path][name].[ext]'},
{from: './node_modules/ckeditor/skins', to: 'ckeditor/skins/[path][name].[ext]'}
]) to: .copyFiles([
// ...
{
from: './node_modules/ckeditor/',
to: 'ckeditor/[path][name].[ext]',
includeSubdirectories: true
},
]) but it doesn’t solve the problem. What’s the reason? Is there any workaround? |
Unfortunately, I have no idea what could be causing this yet :/ |
WorkaroundIf you’re using Symfony-based application and FOSCKEditorBundle:
|
workaraund for me (see https://webpack.js.org/plugins/copy-webpack-plugin/) yarn add copy-webpack-plugin webpack.config.js: const CopyPlugin = require('copy-webpack-plugin');
...
/*.copyFiles({
from: './assets/resources/',
to: 'resources/[path][name].[ext]',
})*/
.addPlugin(
new CopyPlugin({
patterns: [{
from: './assets/resources/',
to: 'resources/[path][name].[ext]',
}],
})
) |
Hey there, As Ryan said that bug is caused by some kind of conflict between how Could someone confirm that the following fix works ?
Note that if you are using |
Hi @Lyrkan, I've just test your branch and it works well for me. |
@Lyrkan Works fine. It solves the problem. |
I still get the same error with Symfony 6... |
I upgraded a project which uses
FOSCKEditorBundle
to use Encore 1.0, and for the most part the upgrade went pretty smoothly. Except for one issue with copying files.We have a config that matches the documentation for using the bundle and Encore, and the process fails out while copying the editor files from
node_modules
topublic/build
. It only affects the plugins directory in that list of configs (commenting that one config out allows the build to succeed, minus all those files), and it looks like it has to do with the fact the various plugins have image files.Even stranger is our full
copyFiles()
config actually does explicitly copy over a few image files, and that does work OK.The text was updated successfully, but these errors were encountered: