magesuite / theme-creativeshop

Open Software License 3.0
38 stars 24 forks source link

When running yarn build. buildWebpack fails #20

Open Lukas-G21 opened 4 years ago

Lukas-G21 commented 4 years ago

Setup new theme with magesuite-theme-generator npm -v 6.14.4 node -v v10.19.0 yarn -v1.21.1

After running: npm install yarn install yarn build fails with below error:


WebpackOptionsValidationError: Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
 - configuration.entry should be an non-empty object.
   -> Multiple entry bundles are created. The key is the chunk name. The value can be a string or an array.
    at webpack (/var/www/html/m2/dev/theme/myTheme/node_modules/@creativestyle/magesuite-frontend-builder/node_modules/webpack/lib/webpack.js:31:9)
    at buildWebpack (/var/www/html/m2/dev/theme/myTheme/node_modules/@creativestyle/magesuite-frontend-builder/gulp/tasks/buildWebpack.js:15:22)
    at taskWrapper (/var/www/html/m2/dev/theme/myTheme/node_modules/undertaker/lib/set-task.js:13:15)
    at bound (domain.js:402:14)
    at runBound (domain.js:415:12)
    at asyncRunner (/var/www/html/m2/dev/theme/myTheme/node_modules/async-done/index.js:55:18)
    at process._tickCallback (internal/process/next_tick.js:61:11)
[14:50:05] 'build' errored after 67 ms
[14:50:05] The following tasks did not complete: copyHtml, copyScripts, copyImages, copyUnchanged
[14:50:05] Did you forget to signal async completion?
error Command failed with exit code 1.
czettnersandor commented 4 years ago

I have the same issue. It happens only when I move the theme out of vendor. I can build the theme inside vendor, but that's not good for me because I can't add my new theme to version control from there. Did you find a solution?

czettnersandor commented 4 years ago

The trick was to have the base theme in the same directory as the new theme. I simply copied it from vendor.

Another issue: yarn build is generating the Magento theme 2 folders above its own location, so make sure you put it somewhere exactly 2 levels deep. Mine is in lib/themes/