From 2a57bb5a85edc1a0498755ce47451800e438152e Mon Sep 17 00:00:00 2001 From: Hrishikesh Kokate Date: Fri, 12 Sep 2025 19:22:37 +0530 Subject: [PATCH 1/2] fix: allow dot files in function bundle --- src/build/content/server.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/build/content/server.ts b/src/build/content/server.ts index fbd289533c..e5beb3ef54 100644 --- a/src/build/content/server.ts +++ b/src/build/content/server.ts @@ -111,6 +111,7 @@ export const copyNextServerCode = async (ctx: PluginContext): Promise => { ], { cwd: srcDir, + dot: true, extglob: true, }, ) From 7866d5b42254041fb5524a38dcc0b6e3cd1f9be2 Mon Sep 17 00:00:00 2001 From: Michal Piechowiak Date: Fri, 12 Sep 2025 17:14:51 +0200 Subject: [PATCH 2/2] test: add e2e test case for dotfile paths --- tests/e2e/simple-app.test.ts | 9 +++++++++ tests/fixtures/simple/app/.well-known/farcaster/route.js | 9 +++++++++ 2 files changed, 18 insertions(+) create mode 100644 tests/fixtures/simple/app/.well-known/farcaster/route.js diff --git a/tests/e2e/simple-app.test.ts b/tests/e2e/simple-app.test.ts index a18a83c3a4..fb790afcff 100644 --- a/tests/e2e/simple-app.test.ts +++ b/tests/e2e/simple-app.test.ts @@ -342,3 +342,12 @@ test.describe('RSC cache poisoning', () => { expect(htmlResponse?.headers()['debug-netlify-cdn-cache-control']).toMatch(/s-maxage=31536000/) }) }) + +test('Handles route with a path segment starting with dot correctly', async ({ simple }) => { + const response = await fetch(`${simple.url}/.well-known/farcaster`) + + expect(response.status).toBe(200) + + const data = await response.json() + expect(data).toEqual({ msg: 'Hi!' }) +}) diff --git a/tests/fixtures/simple/app/.well-known/farcaster/route.js b/tests/fixtures/simple/app/.well-known/farcaster/route.js new file mode 100644 index 0000000000..2bbd2710f9 --- /dev/null +++ b/tests/fixtures/simple/app/.well-known/farcaster/route.js @@ -0,0 +1,9 @@ +import { NextResponse } from 'next/server' + +export async function GET() { + return NextResponse.json({ + msg: 'Hi!', + }) +} + +export const dynamic = 'force-dynamic'