Skip to content

Static API route with wildcard causes file-system conflicts #1978

@fuma-nama

Description

@fuma-nama

when there's an empty path in staticPaths, the error can be reproduced.

// _api/llms.mdx/docs/[...slugs].ts
import { ApiContext } from 'waku/router';
import { unstable_notFound } from 'waku/router/server';

export async function GET(_: Request, { params }: ApiContext<'/llms.mdx/docs/[...slugs]'>) {
  const slugs = params.slugs;
  console.log(slugs);
  return new Response('hello world', {
    headers: {
      'Content-Type': 'text/markdown',
    },
  });
}

export async function getConfig() {
  return {
    render: 'static' as const,
    staticPaths: [[], ['test']],
  } as const;
}
Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions