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

Fetching Initial Data Fails with "no response" Error #341

Open
upandfine opened this issue Jul 12, 2024 · 0 comments
Open

Fetching Initial Data Fails with "no response" Error #341

upandfine opened this issue Jul 12, 2024 · 0 comments

Comments

@upandfine
Copy link

upandfine commented Jul 12, 2024

I'm encountering an issue with the nuxt-typo3 module where fetching initial data fails with a "no response" error.

Steps to Reproduce:

Set up a Nuxt.js project with nuxt-typo3 integration.
Configure the API endpoint as https://api.cms.ddev.site.
Attempt to fetch initial data.

Expected Behavior:
The initial data should be fetched successfully from the API endpoint.

Actual Behavior:
The following error is thrown:

Initial Data is unavailable: [GET] "https://api.cms.ddev.site": <no response> fetch failed

at createError (./node_modules/nuxt/dist/app/composables/error.js:43:43)
at Module.showError (./node_modules/nuxt/dist/app/composables/error.js:16:21)
at t3initialDataMiddleware (./node_modules/@t3headless/nuxt-typo3/dist/runtime/middleware/initialData.mjs:38:27)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Object.callAsync (./node_modules/unctx/dist/index.mjs:72:16)
at async ./node_modules/nuxt/dist/pages/runtime/plugins/router.js:188:26

Additional Information:

The documentation has been read and followed.
Logs are empty except for the error above.
Direct requests to the API endpoint using curl return valid responses.

System Information:

Nuxt.js version: 3.8.1
nuxt-typo3 version: 2.0.0
Node.js version: 22.0.0
DDEV version: 1.23.3

API-Response with
curl -X GET "https://api.cms.ddev.site/" -H "Accept: application/json"

{
  "id": 1,
  "type": "Standard",
  "slug": "/",
  "media": [],
  "meta": {
    "title": "Headless API",
    "subtitle": "",
    "abstract": "",
    "description": "",
    "keywords": "",
    "canonical": "",
    "robots": {
      "noIndex": false,
      "noFollow": false
    },
    "author": "",
    "authorEmail": "",
    "ogTitle": "Headless API",
    "ogDescription": "",
    "ogImage": null,
    "twitterTitle": "Headless API",
    "twitterDescription": "",
    "twitterCard": "summary",
    "twitterImage": null
  },
  "categories": "",
  "breadcrumbs": [
    {
      "title": "Headless API",
      "link": "/",
      "target": "",
      "active": 1,
      "current": 1,
      "spacer": 0,
      "hasSubpages": 0
    }
  ],
  "appearance": {
    "layout": "layout-0",
    "backendLayout": "default"
  },
  "content": {
    "colPos0": [
      {
        "id": 1,
        "type": "header",
        "colPos": 0,
        "categories": "",
        "appearance": {
          "layout": "default",
          "frameClass": "default",
          "spaceBefore": "",
          "spaceAfter": ""
        },
        "content": {
          "header": "Demo Header",
          "subheader": "Demo Sub-Header",
          "headerLayout": 0,
          "headerPosition": "",
          "headerLink": ""
        }
      },
      {
        "id": 2,
        "type": "text",
        "colPos": 0,
        "categories": "",
        "appearance": {
          "layout": "default",
          "frameClass": "default",
          "spaceBefore": "",
          "spaceAfter": ""
        },
        "content": {
          "header": "Demo Text Header",
          "subheader": "",
          "headerLayout": 0,
          "headerPosition": "",
          "headerLink": "",
          "bodytext": "\u003Cp\u003ENur ein Beispieltext\u003C/p\u003E"
        }
      }
    ]
  },
  "i18n": [
    {
      "languageId": 0,
      "locale": "de_DE",
      "title": "Deutsch",
      "navigationTitle": "Deutsch",
      "twoLetterIsoCode": "de",
      "hreflang": "de-DE",
      "direction": "ltr",
      "flag": "flags-de",
      "link": "/",
      "active": 1,
      "current": 0,
      "available": 1
    }
  ]
}

nuxt.config.ts

export default defineNuxtConfig({
  devtools: { enabled: true },

  modules: [
    '@t3headless/nuxt-typo3'
  ],

  typo3: {
    api: {
      baseUrl: process.env.API_BASE || 'https://api.cms.ddev.site',
    }
  },

  compatibilityDate: '2024-07-11'
})
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