vuestorefront / shopware-pwa

Shopware PWA for eCommerce. Headless storefront solution for Shopware 6, which communicates through the SalesChannel-API. Always Open Source, MIT license. Made with :blue_heart: by shopware AG & Vue Storefront.
https://frontends.shopware.com
MIT License
345 stars 103 forks source link

[BUG] 0.4.0 casues import loop #1111

Closed alexschwarz89 closed 3 years ago

alexschwarz89 commented 4 years ago

Describe the bug

` ERROR Failed to compile with 96 errors friendly-errors 10:27:00

ERROR in ./.shopware-pwa/source/assets/scss/main.scss friendly-errors 10:27:00

Module build failed (from ./node_modules/sass-loader/dist/cjs.js): friendly-errors 10:27:00 SassError: An @import loop has been found: .shopware-pwa/source/assets/scss/main.scss imports .shopware-pwa/source/assets/scss/main.scss on line 2 of .shopware-pwa/source/assets/scss/main.scss

// we're importing here main style variables from theme

^`

happens after upgrading to 0.4.0

patzick commented 4 years ago

hey @alexschwarz89, please show the content of your files in src/assets/scss/main.scss and src/assets/scss/variables.scss

alexschwarz89 commented 4 years ago

Sure @patzick

Please note these files are now from canary; because i tried if the error is here aswell, but its the same error.

main.scss

// we're importing here main style variables from theme
@import '~@shopware-pwa/default-theme/assets/scss/main';

// Here you can override you global styles.
// It will be included once on webside and visible unless some more specific styles in components will extend that
//
// note: To override global variables go to variables.scss

// example of global styles you may want to override
// body {
//   font-family: var(--font-family-primary);
//   font-weight: var(--font-light);
//   font-size: var(--font-size-base);
//   line-height: 1.6;
// }

variables.scss


// we're importing here main style variables
@import '~@shopware-pwa/default-theme/assets/scss/variables';

// For available variables check SFUI docs - https://docs.storefrontui.io/customization.html#global-variables
// 
// Please remember to ONLY override variables here, as it will be used in components. 
// If you'd add some styles here as well it would be included in almost every component. You don't want it ;) You can add global styles in main.scss file.

// #__nuxt {
//   --c-primary: #5ece7b;
// }
patzick commented 4 years ago

please go through there migration steps: https://shopware-pwa-docs.vuestorefront.io/landing/getting-started/upgrade.html#migrate-version-0-3-x-to-0-4-x

Old imports are causing loop, sorry we wrote it should still work with old imports: image

alexschwarz89 commented 4 years ago

@patzick as this is a naked install without any customizations i just deleted everyhting and re-ran the setup steps which fails (see output below).

I deleted the folder, run "sudo npm install -g @shopware-pwa/cli" again, and "shopware-pwa init" and i went for the demo shop.

Alexs-MBP-3:storefront alexs$ shopware-pwa init
✔ Shopware instance address: · https://shopware6-demo.vuestorefront.io
✔ Shopware instance access token: · SWSCVJJET0RQAXFNBMTDZTV1OQ
✔ Which version you'd like to use: · latest stable (recommended)
✔ Preparing Nuxt project
⠙ Updating configuration for option: latest stable (recommended)/usr/local/lib/node_modules/@shopware-pwa/cli/node_modules/gluegun/build/index.js:13
    throw up;
    ^

Error: Theme package not found!
    at /usr/local/lib/node_modules/@shopware-pwa/cli/build/extensions/nuxt-extension.js:162:31
    at step (/usr/local/lib/node_modules/@shopware-pwa/cli/build/extensions/nuxt-extension.js:33:23)
    at Object.next (/usr/local/lib/node_modules/@shopware-pwa/cli/build/extensions/nuxt-extension.js:14:53)
    at /usr/local/lib/node_modules/@shopware-pwa/cli/build/extensions/nuxt-extension.js:8:71
    at new Promise (<anonymous>)
    at __awaiter (/usr/local/lib/node_modules/@shopware-pwa/cli/build/extensions/nuxt-extension.js:4:12)
    at EmptyToolbox.toolbox.updateNuxtPackageJson (/usr/local/lib/node_modules/@shopware-pwa/cli/build/extensions/nuxt-extension.js:155:63)
    at /usr/local/lib/node_modules/@shopware-pwa/cli/build/commands/init.js:153:55
    at step (/usr/local/lib/node_modules/@shopware-pwa/cli/build/commands/init.js:33:23)
    at Object.next (/usr/local/lib/node_modules/@shopware-pwa/cli/build/commands/init.js:14:53)
mkucmus commented 4 years ago

@alexschwarz89 we are going to update the docs to encourage people to use npx rather than global npm install to have always the latest version of the package.

please try to run npx @shopware-pwa/cli init to see what happens, I hope it works well for you. and the last thing: please avoid using sudo, it can cause problems with file permissions later on

alexschwarz89 commented 4 years ago

@mkucmus tried the command, getting the same error. about the sudo, i was using it because without the command is not callable on mac o s x somehow(maybe not moved due to permissions?)

mkucmus commented 3 years ago

@alexschwarz89 is it still an issue? If so, please try to use the latest version of CLI in a new/empty directory.

patzick commented 3 years ago

closing, as probably solved a long time ago :)