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

"Unsupported OpenType signature wOF2" when loading Inter in opengraph-image #63935

Open
Southclaws opened this issue Apr 1, 2024 · 0 comments
Labels
bug Issue was opened via the bug report template. Font (next/font) Related to Next.js Font Optimization.

Comments

@Southclaws
Copy link

Southclaws commented Apr 1, 2024

Link to the code that reproduces this issue

codesandbox

To Reproduce

  1. Follow the example in https://nextjs.org/docs/app/api-reference/file-conventions/metadata/opengraph-image
  2. Load Inter v4 WOFF2 file from rsms.me or github - latest release (ttf doesn't work either so trying to use woff2)

Current vs. Expected behavior

The example gives a ttf file but opentype supports woff2 and it's also the default for the web so it should work.

This also works fine with Inter v3 .woff files but not .woff2 - if woff2 is not supported, this will be worth mentioning in the docs because the error message product by this issue is somehow a very low-level stack trace with no actionable information:

 ⨯ Error: failed to pipe response
    at pipeToNodeResponse (/Users/southclaws/work/site/node_modules/next/dist/server/pipe-readable.js:126:15)
    at async DevServer.runEdgeFunction (/Users/southclaws/work/site/node_modules/next/dist/server/next-server.js:1224:13)
    at async NextNodeServer.handleCatchallRenderRequest (/Users/southclaws/work/site/node_modules/next/dist/server/next-server.js:248:37)
    at async DevServer.handleRequestImpl (/Users/southclaws/work/site/node_modules/next/dist/server/base-server.js:807:17)
    at async /Users/southclaws/work/site/node_modules/next/dist/server/dev/next-dev-server.js:339:20
    at async Span.traceAsyncFn (/Users/southclaws/work/site/node_modules/next/dist/trace/trace.js:154:20)
    at async DevServer.handleRequest (/Users/southclaws/work/site/node_modules/next/dist/server/dev/next-dev-server.js:336:24)
    at async invokeRender (/Users/southclaws/work/site/node_modules/next/dist/server/lib/router-server.js:174:21)
    at async handleRequest (/Users/southclaws/work/site/node_modules/next/dist/server/lib/router-server.js:353:24)
    at async requestHandlerImpl (/Users/southclaws/work/site/node_modules/next/dist/server/lib/router-server.js:377:13)
    at async Server.requestListener (/Users/southclaws/work/site/node_modules/next/dist/server/lib/start-server.js:141:13) {
  [cause]: Error: Unsupported OpenType signature wOF2
      at Object.parseBuffer [as parse] (webpack-internal:///(app-metadata-route)/./node_modules/next/dist/compiled/@vercel/og/index.edge.js:11740:11)
      at zt.addFonts (webpack-internal:///(app-metadata-route)/./node_modules/next/dist/compiled/@vercel/og/index.edge.js:16259:52)
      at new zt (webpack-internal:///(app-metadata-route)/./node_modules/next/dist/compiled/@vercel/og/index.edge.js:16241:10)
      at wl (webpack-internal:///(app-metadata-route)/./node_modules/next/dist/compiled/@vercel/og/index.edge.js:17111:63)
      at async render (webpack-internal:///(app-metadata-route)/./node_modules/next/dist/compiled/@vercel/og/index.edge.js:18780:15)
      at async Object.start (webpack-internal:///(app-metadata-route)/./node_modules/next/dist/compiled/@vercel/og/index.edge.js:19007:25)

"Unsupported OpenType signature wOF2" maybe could be interpreted this way but honestly, the stack trace is useless and hides the error. What would be better is a simple "Error: woff2 files are not supported", no need for webpack-internal/node modules lines of code I'll never look at or understand.

Provide environment information

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 23.1.0: Mon Oct  9 21:32:11 PDT 2023; root:xnu-10002.41.9~7/RELEASE_ARM64_T6030
Binaries:
  Node: 21.2.0
  npm: 10.2.3
  Yarn: 1.22.21
  pnpm: 8.10.5
Relevant Packages:
  next: 14.1.4
  eslint-config-next: 14.1.4
  react: 18.2.0
  react-dom: 18.2.0
  typescript: 5.4.3
Next.js Config:
  output: N/A

Which area(s) are affected? (Select all that apply)

Not sure, Font optimization (next/font)

Which stage(s) are affected? (Select all that apply)

next dev (local)

Additional context

I've also tried latest canary - still a problem.

@Southclaws Southclaws added the bug Issue was opened via the bug report template. label Apr 1, 2024
@github-actions github-actions bot added the Font (next/font) Related to Next.js Font Optimization. label Apr 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue was opened via the bug report template. Font (next/font) Related to Next.js Font Optimization.
Projects
None yet
Development

No branches or pull requests

1 participant