Skip to content

Commit 88febdd

Browse files
committed
fix: adjust messaging to mention future support
1 parent 3609d31 commit 88febdd

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

src/build/content/server.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,10 @@ const verifyFunctionsConfigManifest = async (sourcePath: string) => {
389389
// Node.js Middleware has hardcoded /_middleware path
390390
if (manifest.functions['/_middleware']) {
391391
throw new Error(
392-
'Only Edge Runtime Middleware is supported. Node.js Middleware is not supported.',
392+
'Node.js middleware is not yet supported.\n\n' +
393+
'Future @netlify/plugin-nextjs release will support node middleware with following limitations:\n' +
394+
' - usage of C++ Addons (https://nodejs.org/api/addons.html) not supported (for example `bcrypt` npm module will not be supported, but `bcryptjs` will be supported),\n' +
395+
' - usage of Filesystem (https://nodejs.org/api/fs.html) not supported.',
393396
)
394397
}
395398
}

tests/integration/edge-handler.test.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -632,8 +632,18 @@ test.skipIf(!nextVersionSatisfies('>=15.2.0'))<FixtureTestContext>(
632632
'should throw an Not Supported error when node middleware is used',
633633
async (ctx) => {
634634
await createFixture('middleware-node', ctx)
635-
await expect(runPlugin(ctx)).rejects.toThrow(
636-
'Only Edge Runtime Middleware is supported. Node.js Middleware is not supported.',
635+
636+
const runPluginPromise = runPlugin(ctx)
637+
638+
await expect(runPluginPromise).rejects.toThrow('Node.js middleware is not yet supported.')
639+
await expect(runPluginPromise).rejects.toThrow(
640+
'Future @netlify/plugin-nextjs release will support node middleware with following limitations:',
641+
)
642+
await expect(runPluginPromise).rejects.toThrow(
643+
' - usage of C++ Addons (https://nodejs.org/api/addons.html) not supported (for example `bcrypt` npm module will not be supported, but `bcryptjs` will be supported)',
644+
)
645+
await expect(runPluginPromise).rejects.toThrow(
646+
' - usage of Filesystem (https://nodejs.org/api/fs.html) not supported',
637647
)
638648
},
639649
)

0 commit comments

Comments
 (0)