Skip to content

Node.js middleware generating build error #3114

@cshawaus

Description

@cshawaus

Hi,

I am trying out Node.js middleware in 15.5.2, but am running into the build error below.

5:19:41 PM: Plugin "@netlify/plugin-nextjs" internal error                
5:19:41 PM: ────────────────────────────────────────────────────────────────
5:19:41 PM: ​
5:19:41 PM:   Error message
5:19:41 PM:   Error: EISDIR: illegal operation on a directory, read
5:19:41 PM: ​
5:19:41 PM:   Plugin details
5:19:41 PM:   Package:        @netlify/plugin-nextjs
5:19:41 PM:   Version:        5.13.0
5:19:41 PM:   Repository:     git+https://github.com/opennextjs/opennextjs-netlify.git
5:19:41 PM:   npm link:       https://www.npmjs.com/package/@netlify/plugin-nextjs
5:19:41 PM:   Report issues:  https://github.com/opennextjs/opennextjs-netlify/issues
5:19:41 PM: ​
5:19:41 PM:   Error location
5:19:41 PM:   In "onBuild" event in "@netlify/plugin-nextjs" from netlify.toml and package.json
5:19:41 PM:       at async readFileHandle (node:internal/fs/promises:557:24)
5:19:41 PM:       at async copyHandlerDependenciesForNodeMiddleware (file:///opt/build/repo/node_modules/.pnpm/@netlify+plugin-nextjs@5.13.0/node_modules/@netlify/plugin-nextjs/dist/build/functions/edge.js:579:21)
5:19:41 PM:       at async createEdgeHandler (file:///opt/build/repo/node_modules/.pnpm/@netlify+plugin-nextjs@5.13.0/node_modules/@netlify/plugin-nextjs/dist/build/functions/edge.js:597:3)
5:19:41 PM:       at async Promise.all (index 0)
5:19:41 PM:       at async createEdgeHandlers (file:///opt/build/repo/node_modules/.pnpm/@netlify+plugin-nextjs@5.13.0/node_modules/@netlify/plugin-nextjs/dist/build/functions/edge.js:638:3)
5:19:41 PM:       at async Promise.all (index 4)
5:19:41 PM:       at async file:///opt/build/repo/node_modules/.pnpm/@netlify+plugin-nextjs@5.13.0/node_modules/@netlify/plugin-nextjs/dist/index.js:80:5
5:19:41 PM:       at async onBuild (file:///opt/build/repo/node_modules/.pnpm/@netlify+plugin-nextjs@5.13.0/node_modules/@netlify/plugin-nextjs/dist/index.js:68:3)
5:19:41 PM:       at async file:///opt/buildhome/node-deps/node_modules/@netlify/build/lib/plugins/child/run.js:32:9
5:19:41 PM:       at async handleEvent (file:///opt/buildhome/node-deps/node_modules/@netlify/build/lib/plugins/child/main.js:28:42)
5:19:41 PM: ​
5:19:41 PM:   Error properties
5:19:41 PM:   { errno: -21, code: 'EISDIR', syscall: 'read' }

Disabling it allows builds to continue working normally.

Environment Info

  System:
    OS: macOS 15.6.1
    CPU: (12) arm64 Apple M2 Max
    Memory: 407.66 MB / 32.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 22.15.0 - ~/.nvm/versions/node/v22.15.0/bin/node
    Yarn: 1.22.19 - ~/Library/pnpm/yarn
    npm: 10.9.2 - ~/.nvm/versions/node/v22.15.0/bin/npm
    pnpm: 10.13.1 - ~/Library/pnpm/pnpm
    bun: 1.2.21 - /opt/homebrew/bin/bun
  Browsers:
    Chrome: 140.0.7339.81
    Chrome Canary: 142.0.7405.0
    Edge: 140.0.3485.54
    Safari: 18.6
    Safari Technology Preview: 26.0
  npmPackages:
    @netlify/plugin-nextjs: 5.13.1 => 5.13.1
    next: 15.5.2 => 15.5.2

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions