Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DOCS] Make sure that endpoint and accessToken are settled in the configuration #1682

Open
cptprice1139 opened this issue Feb 10, 2025 · 1 comment
Labels
documentation Improvements or additions to documentation

Comments

@cptprice1139
Copy link

cptprice1139 commented Feb 10, 2025

Current Behavior

I have followed the correct setup process of the module for my Nuxt 3 application. I even tried to reproduce the issue in a clean repository and it still occurs.

"Make sure that endpoint and accessToken are settled in the configuration" at /node_modules/@shopware/nuxt-module/plugin.ts

This is my current Nuxt config, with which I am getting the 500 Vite Error above:

export default defineNuxtConfig({ compatibilityDate: '2024-11-01', devtools: { enabled: false }, modules: ['@shopware/nuxt-module'], shopware: { endpoint: process.env.NUXT_PUBLIC_SHOPWARE_ENDPOINT, accessToken: process.env.NUXT_PUBLIC_SHOPWARE_ACCESS_TOKEN, devStorefrontUrl: '' }, runtimeConfig: { public: { broadcasting: false } } })

I also tried putting it in my public runtime config and also tried it without variables.
On a side note I also receiving this issue while building my app:

ERROR Pre-transform error: [unimport] failed to find "createShopwareContext" imported from "#imports" 12:17:38 Plugin: nuxt:imports-transform File: C:/Users/info/Desktop/Fourplex/stg-011/node_modules/@shopware/nuxt-module/plugin.ts?v=7de043c0

Expected Behavior

It should work as expected, no 500 error, connection to the store api should be made.

Steps To Reproduce

Install nuxt^3.15.4
Install the newest shopware packages: nuxt-module, helpers, api-client, composables (10.02.2025)

Run: npm run dev

Anything else?

Node Version: 22.13.1
Npm Version: 10.9.2

No response

@cptprice1139
Copy link
Author

EDIT: This a matter of missing documentation, if I hadn't investigated further especially with the existing templates I would have not found a solution to this problem.

extends: [
    '@shopware/composables/nuxt-layer',
    '@shopware/cms-base-layer'
  ],

This code above is very much required in your nuxt config to get your app running with a connection to shopware. If this extends is not included you will face this issue:

ERROR  Pre-transform error: [unimport] failed to find "createShopwareContext" imported from "#imports"                                                                             
Plugin: nuxt:imports-transform
File: *******************/node_modules/@shopware/nuxt-module/plugin.ts?v=c33e0497

Which simply outputs a internal server error 500 and cannot establish a connection to shopware, because of "missing" endpoint/access token.

I would suggest adding this to the documentation, for nuxt/vue custom projects.

@cptprice1139 cptprice1139 changed the title [BUG] Make sure that endpoint and accessToken are settled in the configuration [BUG][DOCS] Make sure that endpoint and accessToken are settled in the configuration Feb 11, 2025
@BrocksiNet BrocksiNet added documentation Improvements or additions to documentation and removed bug labels Feb 18, 2025
@lasomethingsomething lasomethingsomething changed the title [BUG][DOCS] Make sure that endpoint and accessToken are settled in the configuration [DOCS] Make sure that endpoint and accessToken are settled in the configuration Mar 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
Status: To Triage
Development

No branches or pull requests

2 participants