shopware / frontends

Shopware Frontends is a framework for building custom, headless storefronts with Shopware 6.
https://frontends.shopware.com
MIT License
176 stars 49 forks source link

[BUG] Cannot read properties of undefined (reading 'options') #518

Closed bastianhilton closed 10 months ago

bastianhilton commented 10 months ago

Is there an existing issue for this?

Current Behavior

Following the documentation on Shopware Frontends, it says to add @shopware-pwa/cms-base to the extends: [ ] section of nuxt.config.ts, however whenever I do that and start up my nuxt project I get the following error message.

 ERROR  Cannot read properties of undefined (reading 'options')

 ERROR  Cannot read properties of undefined (reading 'options')

Once I remove the extends my nuxt project is able to startup properly.

Expected Behavior

Following the documention here https://frontends.shopware.com/framework/shopping-experiences.html#install-the-package it doesn't mention to do that, however the templates have it in the extend section and not in the module section. What is the correct way of adding this module to the nuxt.config.ts file?

Steps To Reproduce

Create Nuxt Project install @shopware-pwa/cms-base module Add it to the extends: ["@shopware-pwa/cms-base"] section of your nuxt.config.ts(.js) file Start up the project

Environment

- OS: Windows 11
- Node: 21.1.0
- pnpm: N/A

Anything else?

N/A

mkucmus commented 10 months ago

CMS Base package as a layer is available only in canary version currently. Once the maturity of the setup is enough, the documentation will be updated for this option as well.

You mentioned the docs, and there is no word about using layers yet, so if you are using the latest or a specific stable version, please don't use layers. We are working on that 🙌🏼

So, what you see in the repository under the main branch, is currently published as a canary version (That's why templates are using the new layers approach), so if you need to experiment with that, please adjust your package.json in the project.

here's the example with a new nuxt project using frontends stack on layers: https://stackblitz.com/edit/github-96hyiy?file=package.json