zeromq works standalone but not when used within Next.js: "No native build was found for ..." #61844
Labels
bug
Issue was opened via the bug report template.
linear: next
Confirmed issue that is tracked by the Next.js team.
locked
Link to the code that reproduces this issue
https://github.com/eulersson/zeromq.js-next.js-errors
To Reproduce
Manually
Basically create a next app
npx create-next-app@latest
with all the defaults, installzeromq
npm install zeromq@6.0.0-beta.19
, import it anywhere inapp/page.tsx
(e.g.import { Push } from "zeromq";
andconst sock = new Push();
anywhere in your file),start the development server
npm run dev
and visithttp://localhost:3000
.Reproducible Container
git@github.com:eulersson/zeromq.js-node.js-errors.git
docker build -t zeromq-nextjs
docker run --rm -it -p 3000:3000 nextjs-zeromq
http://localhost:3000
on your host browser.Current vs. Expected behavior
Observations
If I change this line in the
node-gyp-build/index.js
todir = '/absolute/path/to/node_modules/zeromq'
then it works! It seems that it needs to be in.next/server
... Because it looks for the prebuilds in there. I read and tried (unsuccessfully) the feature to includes files to the tracing process that happens where only the relevant files are moved to.next/server
so a standalone server can use that reduced selection of dependencies.Error Log
Full error log attached:
full-error-log.txt
Error log except:
Provide environment information
Operating System: Platform: linux Arch: x64 Version: #1-Alpine SMP PREEMPT_DYNAMIC Mon, 05 Jun 2023 09:39:09 +0000 Binaries: Node: 20.11.0 npm: 10.2.4 Yarn: 1.22.19 pnpm: N/A Relevant Packages: next: 14.1.0 eslint-config-next: 14.1.0 react: 18.2.0 react-dom: 18.2.0 typescript: 5.3.3 Next.js Config: output: N/A
Which area(s) are affected? (Select all that apply)
Not sure
Which stage(s) are affected? (Select all that apply)
next dev (local), next build (local), next start (local)
Additional context
I cannot have this simple hello world app running on macOS 14.1.1 either...
NEXT-2485
The text was updated successfully, but these errors were encountered: