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

getInitialDataPath not really using configured endpoints #329

Open
MichaelNussbaumerGOWEST opened this issue Jan 15, 2024 · 0 comments
Open

Comments

@MichaelNussbaumerGOWEST

/src/runtime/middleware/initialData.ts

The configured Endpoints in nuxt.config.ts are not used when calling a page and the api returns 404 for that page.

So basically the function (getInitialDataPath) returns only "/" and therefore also without any query parameter. So the initialData on an 404 error page is always the content from https://api.example.com/.

nuxt.config.ts:

typo3: {
        baseUrl: `https://${process.env.SITEMAP_DOMAIN}`,
        api: {
            baseUrl: `https://${process.env.TYPO3_DOMAIN}`,
            headers: {},
            credentials: "omit",
            proxyHeaders: false,
            allowQuery: ["no_cache"],
            endpoints: {
                initialData: "/de/?type=834",
                initialDataFallback: "/de/?type=834",
            },
        },

        i18n: {
            default: "de",
            locales: ["de", "en"],
        },
    },

I would expect, that if the initialDataFallback is used (for example here: /de/xxxxxxxxxxxxxxxxxxxxxx), then I get initial data from from the fallback URL not from the page without any type parameter (homepage)

Hope I was able to explain the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant