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

Og-image is empty when running SSG with Qwik #2

Closed
storrisi opened this issue Jan 19, 2024 · 6 comments
Closed

Og-image is empty when running SSG with Qwik #2

storrisi opened this issue Jan 19, 2024 · 6 comments
Assignees
Labels
documentation Improvements or additions to documentation question Further information is requested

Comments

@storrisi
Copy link

Probably i'm missing something, but for some reason, when I run a build of a Qwik website, that generates an empty og-image file, even locally.

I'm currently deploying the website over Github Pages, and everytime I make a request towards website-url/og-image an empty file is downloaded.

I don't know what should be the correct behavior, probably this won't work with SSG?

Thanks a lot

@fabian-hiller
Copy link
Owner

og-img requires a server endpoint. Otherwise, it is not possible to generate a dynamic image, and if your image is static, you probably don't need og-image because you could just add an image file to your /public directory.

@fabian-hiller fabian-hiller self-assigned this Jan 19, 2024
@fabian-hiller fabian-hiller added the question Further information is requested label Jan 19, 2024
@fabian-hiller
Copy link
Owner

If you want a static site with a dynamic OG image, you could use og-image to deploy an AWS Lamda or Google Cloud function independently of your Qwik app. Or you could try Netlify and host everything on the edge. That's what I do with Valibot.

@JoepKockelkorn
Copy link

Ran into this as well, might be good to mention this in the README.

@fabian-hiller fabian-hiller added the documentation Improvements or additions to documentation label Mar 14, 2024
@fabian-hiller
Copy link
Owner

Yes, I will add an info.

@JoepKockelkorn
Copy link

JoepKockelkorn commented Mar 14, 2024

@fabian-hiller I managed to exclude the route that generates the og-image from SSG (so it uses SSR), but I'm now getting this error:

CompileError: WebAssembly.instantiate(): Wasm code generation disallowed by embedder
    at (q-C8RaJ7ou.js:119:7794)
    at (q-C8RaJ7ou.js:119:9924)
    at (q-C8RaJ7ou.js:119:10084)
    at (q-C8RaJ7ou.js:186:29695)

I guess this is a security measure?

FYI I've built for Vercel Edge using the proper Qwik City adapter.

Also, this seems equivalent: someone ran into the same issue but on Cloudflare Pages.

Edit: this is the PR I'm testing with.

@fabian-hiller
Copy link
Owner

This is an issue with Vercel. It may be configurable. og-img dynamically loads a WASM file. Issue #3 is related to your problem.

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 question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants