Skip to content

[BUG] Can't build next-intl middleware with OpenNext #683

@maamokun

Description

@maamokun

Describe the bug

When I try to deploy an app that uses next-inti's middleware with the lates version of OpenNext, I get the following error:

23:19:58.239 | Bundling middleware function...
-- | --
23:19:58.441 | ✘ [ERROR] No matching export in "node_modules/@opennextjs/aws/dist/adapters/config/index.js" for import "PagesManifest"
23:19:58.442 |  
23:19:58.442 | node_modules/@opennextjs/aws/dist/core/routing/routeMatcher.js:1:32:
23:19:58.443 | 1 │ ... { AppPathRoutesManifest, PagesManifest, RoutesManifest, } from ...
23:19:58.443 | ╵                              ~~~~~~~~~~~~~
23:19:58.443 |  
23:19:58.448 | /opt/buildhome/repo/node_modules/esbuild/lib/main.js:1463
23:19:58.449 | let error = new Error(text);
23:19:58.449 | ^
23:19:58.449 |  
23:19:58.449 | Error: Build failed with 1 error:
23:19:58.449 | node_modules/@opennextjs/aws/dist/core/routing/routeMatcher.js:1:32: ERROR: No matching export in "node_modules/@opennextjs/aws/dist/adapters/config/index.js" for import "PagesManifest"

The same app using a much older, pre-1.0 version of OpenNext (0.5.10) builds with no problems, however i am unable to get it working with the newest OpenNext release

Steps to reproduce

Scaffold and deploy a Next.js app using next-intl and its middleware with OpenNext

Expected behavior

App deploying without issues

@opennextjs/cloudflare version

1.0.4

Wrangler version

4.16.1

next info output

Operating System:
  Platform: win32
  Arch: x64
  Version: Windows 11 Pro
  Available memory (MB): 65464
  Available CPU cores: 16
Binaries:
  Node: 22.15.0
  npm: 10.9.2
  Yarn: 1.22.22
  pnpm: 9.4.0
Relevant Packages:
  next: 15.3.2 // Latest available version is detected (15.3.2).
  eslint-config-next: N/A
  react: 19.1.0
  react-dom: 19.1.0
  typescript: 5.4.5
Next.js Config:
  output: N/A

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions