Have you upgraded your old Sage 9.x theme to webpack 5 using the latest commit in Sage 9 branch of Sage repository?
Have you applied this Theme update approach (previously used for the Sage 9.x update branch (Sage "9.1": Please test))?
Updating an existing Sage 9 theme (quick guide)
- Create a new Sage 9 project with the command above,
select the framework that is also used by your own Sage 9 project. - (It is assumed that your own Sage project is already under version control (as
git
).
Copy all the files of the newly created, empty Sage 9 project over the ones of your own Sage 9 project,
overwrite everything. You can skip thevendor/
folder to speed things up slightly. - Use diff/merge tools to resolve any differences, apply your own configuration and adjust it if necessary. Updating to
webpack
4
and5
requires surprisingly little configuration changes. - Invoke
composer update
or, if there is trouble, remove thecomposer.lock
file (it shouldn’t cause issues most of the time) and invokecomposer install
. - Invoke
npm install
, or, if there is trouble, remove thepackage-lock.json
and/oryarn.lock
(it shouldn’t cause issues as the base dependencies are already maxed out) and invokenpm install
.
Also note that recentnpm
is much faster than in the earlier days, so you may want to switch back tonpm
, but this is up to you. - Invoke
npm run build
, the theme should build fine, fix your re-applied configuration if otherwise. - Test your theme, styles and images should load as before.