Small example of using @vercel/og
in your Remix app.
tootallnate / remix-og Goto Github PK
View Code? Open in Web Editor NEWSmall example of using `@vercel/og` in your Remix app
Home Page: https://remix-og.vercel.app/og
Small example of using `@vercel/og` in your Remix app
Home Page: https://remix-og.vercel.app/og
We've encountered an issue with the vercel/og package breaking our development build.
pnpm install
.pnpm dev
.We have a similar setup to this repository (using remix + vercel/og + Vercel edge deployment). When we import vercel/og using the import syntax just like in this repo, our development build stops working.
pnpm dev
> @ dev /User/k9/code/remix-og
> remix dev
๐ฟ remix dev
info building...
warn esm-only package: @vercel/og
โ @vercel/og is possibly an ESM-only package.
โ To bundle it with your server, include it in `serverDependenciesToBundle`
โ -> https://remix.run/docs/en/main/file-conventions/remix-config#serverdependenciestobundle
โ
info built (2.2s)
/User/k9/code/remix-og/build/index.js:330
var import_og = require("@vercel/og"), import_jsx_dev_runtime5 = require("react/jsx-dev-runtime"), config2 = { runtime: "edge" };
^
Error [ERR_REQUIRE_ESM]: require() of ES Module /User/k9/code/remix-og/node_modules/.pnpm/@[email protected]/node_modules/@vercel/og/dist/index.node.js from /User/k9/code/remix-og/build/index.js not supported.
Instead change the require of index.node.js in /User/k9/code/remix-og/build/index.js to a dynamic import() which is available in all CommonJS modules.
at Object.<anonymous> (/User/k9/code/remix-og/build/index.js:330:17)
at Object.<anonymous> (/User/k9/code/remix-og/node_modules/.pnpm/@[email protected]/node_modules/@remix-run/serve/dist/cli.js:38:13)
Is there a recommended workaround for this issue other than using the require syntax for vercel/og?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.