Hallo in die Runde,
Ich habe heute eine Version von Shopware Composable Frontends aufgesetzt und Deployed.
Wir hatten vorher eine PWA Version und möchten diese nun auf Composable Frontends umsetzen.
Im Großen und Ganzen hat alles ziemlich gut und deutlich einfacher als noch bei der PWA geklappt.
Ich habe jedoch ein Problem. Alle dynamischen Routen führen auf eine 404 bzw. sogar auf einen Serverfehler.
Das merkwüridige ist jedoch, dass in der Entwicklungsumgebung alles wie gewünscht funktioniert.
Hier ein beispiel:
home-5014627656.app-ionos.space/checkout/success/018bf275f69573ec9287f88bf65636be/paid → führt auf eine Seite „The requested URL was not found on this server.“ (öffentlich zugängliche Seite)
Der Localhost führt jedoch zur korrekten Seite.
http://localhost:3000/checkout/success/018bf275f69573ec9287f88bf65636be/paid
Deployed ist das ganze per Githup Action über DeployNow. Ich bin mir ziemlich sicher, dass es irgendwas mit dem Deployment bzw dem Rendering zu tun haben muss.
Hier noch meine Nuxt.config
// https://v3.nuxtjs.org/docs/directory-structure/nuxt.config
export default defineNuxtConfig({
runtimeConfig: {
shopware: {
shopwareEndpoint: "https://s23511.creoline.cloud/webdev-staging"
},
public: {
shopware: {
shopwareEndpoint: "https://s23511.creoline.cloud/webdev-staging",
shopwareAccessToken: "**************",
devStorefrontUrl: "",
}
},
},
routeRules: {
"/": {
isr: 60 * 60 * 24,
},
"/checkout": {
ssr: true,
headers: {
"Cache-Control": "no-cache, no-store, must-revalidate",
},
},
"/checkout/**": {
ssr: true,
},
"/login": {
ssr: false,
},
"/register": {
ssr: true,
},
"/reset-password": {
ssr: true,
},
"/wishlist": {
ssr: true,
},
"/account": {
ssr: true,
},
"/account/**": {
ssr: true,
},
"/search": {
ssr: true,
},
"/search/**": {
ssr: true,
},
"/**": {
isr: 60 * 60 * 24,
},
},
/**
* Commented because of the StackBlitz error
* Issue: https://github.com/shopware/frontends/issues/88
*/
typescript: {
// typeCheck: true,
strict: true,
},
modules: [
"@vueuse/nuxt",
"@unocss/nuxt",
"@shopware-pwa/nuxt3-module",
"@shopware-pwa/cms-base",
"@nuxt/devtools",
"@nuxtjs/i18n",
],
// components: true,
components: {
dirs: [
{
path: "~/components",
priority: 2,
},
],
global: true,
},
vueuse: {
ssrHandlers: true,
},
nitro: {
compressPublicAssets: true,
},
unocss: {
// for presets, theme config, ... look at the uno.config.ts file
},
css: [
"@unocss/reset/tailwind-compat.css",
'bootstrap/dist/css/bootstrap.min.css' // needed to reset styles see https://unocss.dev/guide/style-reset (@unocss/reset)
],
router: {
options: {
linkExactActiveClass: "text-brand-primary",
},
},
i18n: {
strategy: "prefix_except_default",
defaultLocale: "en-GB",
detectBrowserLanguage: false,
langDir: "./i18n/src/langs/",
vueI18n: "./i18n/config",
compilation: {
jit: false,
},
locales: [
{
code: "en-GB",
iso: "en-GB",
file: "en-GB.ts",
},
{
code: "pl-PL",
iso: "pl-PL",
file: "pl-PL.ts",
},
{
code: "de-DE",
iso: "de-DE",
file: "de-DE.ts",
},
],
experimental: {
jsTsFormatResource: true,
},
},
});