Skip to content

Potential issue with OpenAPI and APIPageWrapper #2713

@AaronLayton

Description

@AaronLayton

To Reproduce

I have been upgrading my project due to the recent security advisory from https://nextjs.org/blog/CVE-2025-66478

"next": "15.5.2",
"fumadocs-core": "15.7.10",
"fumadocs-docgen": "^3.0.0",
"fumadocs-mdx": "11.9.0",
"fumadocs-openapi": "^9.3.7",
"fumadocs-twoslash": "^3.1.7",
"fumadocs-typescript": "^4.0.8",
"fumadocs-ui": "15.7.10",

to

"next": "16.0.7",
"fumadocs-core": "16.2.3",
"fumadocs-docgen": "^3.0.4",
"fumadocs-mdx": "14.1.0",
"fumadocs-openapi": "^10.1.0",
"fumadocs-twoslash": "^3.1.10",
"fumadocs-typescript": "^4.0.13",
"fumadocs-ui": "16.2.3",

My site was functioning before, and I am just piecing together the bits I need to upgrade. I fully expect this to be something I am doing wrong, but all I can do atm is narrow down to where the error is coming from.

Current vs. Expected behavior

Previous builds, generated docs perfectly fine and I could view the documentation.

After upgrading, I can still generate the docs files, but when I try to view them I get the below error

<path-to-my-project>\.next\dev\server\chunks\ssr\node_modules_fumadocs-openapi_dist_8c6f7a0f._.js: Invalid source map. Only conformant source maps can be used to find the original code. Cause: Error: sourceMapURL could not be parsed
 ⨯ TypeError: Cannot destructure property 'dereferenced' of 'processed' as it is undefined.
    at ignore-listed frames {
  digest: '413089178'
}
 GET /docs/api/v1/customers/post 500 in 3.0s (compile: 407ms, render: 2.6s)

I can only narrow this down to this section of code but I don't think I am in control of this.

return async function APIPageWrapper({ document, ...props }) {
        let processed;
        if (typeof document === 'string') {
            processed = (await server.getSchemas())[document];
        } else {
            processed = await document;
        }
        const { dereferenced } = processed;

I expect this is something I am doing wrong

Provide environment information

Operating System:
  Platform: win32
  Arch: x64
  Version: Windows 11 Pro
  Available memory (MB): 32679
  Available CPU cores: 32                                                          
Binaries:
  Node: 22.20.0
  npm: 10.9.3
  Yarn: 1.22.22
  pnpm: N/A
Relevant Packages:
  next: 16.0.7 // Latest available version is detected (16.0.7).
  eslint-config-next: N/A
  react: 19.2.1
  react-dom: 19.2.1
  typescript: 5.9.3
Next.js Config:
  output: N/A

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

Integrations (e.g OpenAPI, Typescript DocsGen)

Additional context

My lib/openapi.ts is simple enough

import { createOpenAPI } from 'fumadocs-openapi/server';
import { SWAGGER_URL } from './config';

export const openapi = createOpenAPI({
  input: [SWAGGER_URL]
});

I have the api-page.tsx and api-page.client.tsx from teh documentation with no edits. I have also included APIPage in my mdx-components.tsx

Image

To note, all other documentation pages I create are now working as expected, it is just the APIPage ones

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions