From 2adf9e74a71ae6f8f5d12a2c39c2ee90878b4e05 Mon Sep 17 00:00:00 2001 From: Hendrik Liebau Date: Fri, 15 Nov 2024 13:13:45 +0100 Subject: [PATCH] Use `"experimental.cacheHandlers"` in error message Co-authored-by: Janka Uryga --- .../src/transforms/server_actions.rs | 2 +- .../errors/server-actions/server-graph/16/output.stderr | 2 +- .../errors/server-actions/server-graph/17/output.stderr | 2 +- .../use-cache-unknown-cache-kind.test.ts | 8 ++++---- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/crates/next-custom-transforms/src/transforms/server_actions.rs b/crates/next-custom-transforms/src/transforms/server_actions.rs index af7e7f546365e..f8949d3db7c20 100644 --- a/crates/next-custom-transforms/src/transforms/server_actions.rs +++ b/crates/next-custom-transforms/src/transforms/server_actions.rs @@ -2938,7 +2938,7 @@ fn emit_error(error_kind: ServerActionsErrorKind) { span, formatdoc! { r#" - Unknown cache kind "{cache_kind}". Please configure a cache handler for this kind in the experimental "cacheHandlers" object in your Next.js config. + Unknown cache kind "{cache_kind}". Please configure a cache handler for this kind in the "experimental.cacheHandlers" object in your Next.js config. "# }, ), diff --git a/crates/next-custom-transforms/tests/errors/server-actions/server-graph/16/output.stderr b/crates/next-custom-transforms/tests/errors/server-actions/server-graph/16/output.stderr index 9bfb78fcee2da..5354e8d5920c6 100644 --- a/crates/next-custom-transforms/tests/errors/server-actions/server-graph/16/output.stderr +++ b/crates/next-custom-transforms/tests/errors/server-actions/server-graph/16/output.stderr @@ -1,4 +1,4 @@ - x Unknown cache kind "x". Please configure a cache handler for this kind in the experimental "cacheHandlers" object in your Next.js config. + x Unknown cache kind "x". Please configure a cache handler for this kind in the "experimental.cacheHandlers" object in your Next.js config. | ,-[input.js:1:1] 1 | 'use cache: x' diff --git a/crates/next-custom-transforms/tests/errors/server-actions/server-graph/17/output.stderr b/crates/next-custom-transforms/tests/errors/server-actions/server-graph/17/output.stderr index fa0d10e383994..99bae2533eecc 100644 --- a/crates/next-custom-transforms/tests/errors/server-actions/server-graph/17/output.stderr +++ b/crates/next-custom-transforms/tests/errors/server-actions/server-graph/17/output.stderr @@ -1,4 +1,4 @@ - x Unknown cache kind "x". Please configure a cache handler for this kind in the experimental "cacheHandlers" object in your Next.js config. + x Unknown cache kind "x". Please configure a cache handler for this kind in the "experimental.cacheHandlers" object in your Next.js config. | ,-[input.js:2:1] 1 | export async function foo() { diff --git a/test/e2e/app-dir/use-cache-unknown-cache-kind/use-cache-unknown-cache-kind.test.ts b/test/e2e/app-dir/use-cache-unknown-cache-kind/use-cache-unknown-cache-kind.test.ts index 499d03436220a..75e50a62cc4f8 100644 --- a/test/e2e/app-dir/use-cache-unknown-cache-kind/use-cache-unknown-cache-kind.test.ts +++ b/test/e2e/app-dir/use-cache-unknown-cache-kind/use-cache-unknown-cache-kind.test.ts @@ -46,7 +46,7 @@ describe('use-cache-unknown-cache-kind', () => { 3 | export default async function Page() { 4 | return

hello world

- Unknown cache kind "custom". Please configure a cache handler for this kind in the experimental "cacheHandlers" object in your Next.js config. + Unknown cache kind "custom". Please configure a cache handler for this kind in the "experimental.cacheHandlers" object in your Next.js config. @@ -56,7 +56,7 @@ describe('use-cache-unknown-cache-kind', () => { expect(buildOutput).toMatchInlineSnapshot(` " ./app/page.tsx - Error: x Unknown cache kind "custom". Please configure a cache handler for this kind in the experimental "cacheHandlers" object in your Next.js config. + Error: x Unknown cache kind "custom". Please configure a cache handler for this kind in the "experimental.cacheHandlers" object in your Next.js config. | ,-[1:1] 1 | 'use cache: custom' @@ -96,12 +96,12 @@ describe('use-cache-unknown-cache-kind', () => { 3 | export default async function Page() { 4 | return

hello world

- Unknown cache kind "custom". Please configure a cache handler for this kind in the experimental "cacheHandlers" object in your Next.js config." + Unknown cache kind "custom". Please configure a cache handler for this kind in the "experimental.cacheHandlers" object in your Next.js config." `) } else { expect(errorSource).toMatchInlineSnapshot(` "./app/page.tsx - Error: x Unknown cache kind "custom". Please configure a cache handler for this kind in the experimental "cacheHandlers" object in your Next.js config. + Error: x Unknown cache kind "custom". Please configure a cache handler for this kind in the "experimental.cacheHandlers" object in your Next.js config. | ,-[1:1] 1 | 'use cache: custom'