nuxt-modules / og-image

Generate OG Images with Vue templates in Nuxt.
https://nuxtseo.com/og-image
361 stars 23 forks source link

Error with localhost on a HTTPS Configuration with -https #142

Closed vanling closed 3 months ago

vanling commented 5 months ago

I am currently running a Nuxt.js application on localhost with HTTPS enabled. The relevant configuration in my package.json file is as follows:

"dev": "nuxt dev --host local.interiorboards.nl --https --ssl-cert local.interiorboards.nl.pem --ssl-key local.interiorboards.nl-key.pem"

Despite this setup, I am encountering an error, which is visible in the developer tools console:

Error: [GET] "/__og-image__/image/moodboard-sweet-embrace-edcabaff/og.json": 500 Internal Server Error

Furthermore, when accessing the specific URL, it appears that the request is being made over http instead of https. This results in a failure, as there is no service running on port 80. The error message is:

[GET] "http://local.interiorboards.nl:3000/_nuxt/components/theHeader.vue?vue&type=style&index=0&scoped=0b6386d2&lang.css&hmr=false": <no response> fetch failed
harlan-zw commented 5 months ago

Thanks for the issue, the problem would lie at https://github.com/harlan-zw/nuxt-site-config/blob/main/packages/module/src/runtime/nitro/composables/useNitroOrigin.ts if anyone is willing to help with a PR, otherwise will try look at this when I have a chance

harlan-zw commented 3 months ago

This should be working better with 3.0.0-rc.40