-
-
Notifications
You must be signed in to change notification settings - Fork 197
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
Encore.copyFiles() broken with NodeJS 18.12 (LTS) #1170
Comments
We may need to deprecate and remove our super-fancy |
Just curious if anyone's come up with a workaround or alternative solution here, especially with Node 16 coming up to its EOL. The main use case I have in apps using Encore is using NPM to manage my CKEditor build/version and copying the files over when building the assets (which I know we could do in other ways, but it just makes everything simpler for everyone to have it all in one build step). |
I tried using From looking at the docs, I suspect |
@mattsbennett Could you please post an example of how to add that rule to yarn add asset --dev
yarn remove file-loader And the call I'd need to replace is: .copyFiles({
from: './assets/images',
to: 'images/[path][name].[hash:8].[ext]',
}) @weaverryan Since according to https://nodejs.org/en/about/previous-releases, Node.js 16 has reached EOL already, I think https://symfony.com/doc/current/frontend/encore/copy-files.html#referencing-image-files-from-a-template should be updated. Should I come up with a PR? Or what's your plan? |
When running Encore.copyFiles() with webpack-encore 4.1.2 using the new NodeJS LTS release (18.12), the following error is thrown:
Encore.copyFiles() internally uses https://github.com/webpack-contrib/file-loader, which was last released over 2 years ago and deprecated with webpack 5, so file-loader won't get any updates to be compatible to NodeJS 17 and above. The recommendation is to switch to webpack 5 asset modules.
As webpack-encore requires webpack ^5.72 in its peer dependencies, I would consider this a bug.
The text was updated successfully, but these errors were encountered: