Shopware 6 ./build-storefront.sh webpack module not found

256 Views Asked by At

I want to compile js in Shopware 6 by ./bin/build-storefront.sh (in docker), but I got following errors:

# Webpack Plugin Injector: Plugin "TanmarNgInfiniteScrolling" injected as a new entry point
# Webpack Plugin Injector: Plugin "NetiNextStoreLocator" injected with custom config
/sw6/vendor/shopware/storefront/Resources/app/storefront/node_modules/webpack-cli/bin/cli.js:93
              throw err;
              ^

Error: Cannot find module '/sw6/vendor/store.shopware.com/NetiNextStoreLocator/src/Resources/app/storefront/build/webpack.config.js'

...

code: 'MODULE_NOT_FOUND',
requireStack: [
  '/sw6/vendor/store.shopware.com/netinextstorepickup/src/Resources/app/storefront/build/webpack.config.js',
  '/sw6/vendor/shopware/storefront/Resources/app/storefront/node_modules/@shopware-ag/webpack-plugin-injector/index.js',
  '/sw6/vendor/shopware/storefront/Resources/app/storefront/webpack.config.js',
  '/sw6/vendor/shopware/storefront/Resources/app/storefront/node_modules/webpack-cli/bin/utils/convert-argv.js',
  '/sw6/vendor/shopware/storefront/Resources/app/storefront/node_modules/webpack-cli/bin/cli.js',
  '/sw6/vendor/shopware/storefront/Resources/app/storefront/node_modules/webpack/bin/webpack.js'
]}

I have tried a lot of solutions, but it don't help me for example: install npm global or locally, install webpack, webpack-cli also global or locally, and through apt install webpack too. Nothing helps, still the same errors.

1

There are 1 best solutions below

0
Andy On

I also have experienced errors like this when building the storefront in the past. The message is a bit misleading I think. Though I could not directly find the source, I can give you a few hints you may want to try out:

  1. Did you try an npm install and/or composer install within the plugin-folder? This could fix this error.
  2. This is more like a workaround... The plugins you are using (e.g. NetiNextStoreLocator) do not require the storefront to be built. They are shipped with pre-build js/css files. Try to deactivate the plugins which cause the error, build the storefront, and reactivate it.