Giter Club home page Giter Club logo

remix-og's Introduction

Remix + @vercel/og

Small example of using @vercel/og in your Remix app.

remix-og's People

Contributors

tootallnate avatar

Watchers

 avatar  avatar

remix-og's Issues

vercel/og breaks dev build

We've encountered an issue with the vercel/og package breaking our development build.

Steps to reproduce:

  • Clone this repository.
  • Run pnpm install.
  • Execute 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.

Error message received:

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?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.