Comments (7)
This is fixed in Bun v1.0.30 which releases in about an hour
In the meantime, you can upgrade with bun upgrade --canary
from bun.
Would it be possible to share a minimal repro? Also if you could describe how many requests you're sending before you experience this error? (or if the error always occurs)
from bun.
I just started seeing this issue in an existing site that was fine for the last few months up until this week. Not sure yet what is causing it, but if I find out I will update this ticket
from bun.
It sounds like something is passing undefined
to require
. The question is what/why
from bun.
Restarting my docker container fixed this (no rebuild), which is not a great answer or workaround. I am not sure how to reproduce it at this point, but for context, here is my dockerfile:
FROM imbios/bun-node:18-slim AS base
ARG DEBIAN_FRONTEND=noninteractive
FROM base AS deps
WORKDIR /app
COPY package.json bun.lockb ./
RUN bun install
FROM base AS builder
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY . .
ENV NEXT_TELEMETRY_DISABLED 1
RUN bun run build
FROM base AS runner
WORKDIR /app
ENV NODE_ENV production
ENV NEXT_TELEMETRY_DISABLED 1
COPY --from=builder /app/public ./public
RUN mkdir .next
COPY --from=builder /app/.next/standalone ./
COPY --from=builder /app/.next/static ./.next/static
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
ENV PORT 3000
EXPOSE 3000
ENV HOSTNAME "0.0.0.0"
CMD ["bun", "run", "server.js"]
If I encounter the issue again, I will try to enter the container to see if I find anything else.
Open for full stack trace
57 | }).bind(null, resolveFilename, hookPropertyMap); 58 | // This is a hack to make sure that if a user requires a Next.js module that wasn't bundled 59 | // that needs to point to the rendering runtime version, it will point to the correct one. 60 | // This can happen on `pages` when a user requires a dependency that uses next/image for example. 61 | mod.prototype.require = function(request) { 62 | if (request.endsWith(".shared-runtime")) { ^ TypeError: request.endsWith is not a function. (In 'request.endsWith(".shared-runtime")', 'request.endsWith' is undefined) at /app/node_modules/next/dist/server/require-hook.js:62:9 at getEdgeFunctionsPages (/app/node_modules/next/dist/server/next-server.js:926:26) at /app/node_modules/next/dist/server/next-server.js:885:17 at renderErrorToResponseImpl (/app/node_modules/next/dist/server/next-server.js:873:37) at /app/node_modules/next/dist/server/base-server.js:2001:107 at renderErrorToResponse (/app/node_modules/next/dist/server/base-server.js:2000:33) at /app/node_modules/next/dist/server/base-server.js:1988:36 at /app/node_modules/next/dist/server/base-server.js:1987:33 at /app/node_modules/next/dist/server/base-server.js:911:31 at pipeImpl (/app/node_modules/next/dist/server/base-server.js:901:24) at /app/node_modules/next/dist/server/base-server.js:899:123 at pipe (/app/node_modules/next/dist/server/base-server.js:898:20) at renderErrorImpl (/app/node_modules/next/dist/server/base-server.js:1983:27) at /app/node_modules/next/dist/server/base-server.js:1979:97 at renderError (/app/node_modules/next/dist/server/base-server.js:1978:23) at renderError (/app/node_modules/next/dist/server/next-server.js:899:23) at /app/node_modules/next/dist/server/base-server.js:777:28
from bun.
Have same issue with nextjs 14.1, added guards patch but at the end it goes deeper into errors
patch:
if (request && typeof request === "object" && request.endsWith(".shared-runtime")) { return originalRequire.call(this,
next/dist/server/future/route-modules/pages/vendored/contexts/${path.basename(request, ".shared-runtime")}); } return originalRequire.call(this, request);
from bun.
We are getting this error as well, when running NextJS app with bun in docker. We are using custom API endpoint for K8S to do health check against pod and so this error happens as soon as the app deploys.
Our workaround was to run the app using nodejs in the meantime.
from bun.
Related Issues (20)
- [Bug]: Imports sometimes resolve to garbage file URLs HOT 7
- Vite 5.2.0 `Cannot find module @rollup/rollup-darwin-x64` on M3 Mac HOT 2
- Segmentation fault when creating project with `bun create` HOT 2
- Segmentation fault at address 0xFFFFFFFFFFFFFFFF running `bun upgrade` HOT 1
- `bun update` replacing tilde with caret on `package.json`
- Is `bun install` hanging if there is no `bun.lockb` and `package-lock.json`?
- bun add error
- Crash Report: Bun Upgrade HOT 1
- "bun upgrade" used to work for me, but fails now
- Bun crashed HOT 1
- Crash on Windows that (likely) occurs when making a fetch request
- bun v1.1.12 [WINDOWS?] stuck resolving when adding/installing package NOT in cache HOT 2
- un v1.1.10 (5102a944) Linux x64 (baseline) Args: "bun" "create" "elysia" "app" Elapsed: 48ms | User: 4ms | Sys: 9ms RSS: 1.07GB | Peak: Fetching package.json... 17.02MB | Commit: 1.07GB | Faults: 2 panic: Illegal instruction at address 0x55A116642F5F oh no: Bun has crashed. This indicates a bug in Bun, not your code.
- PowerShell terminal crashes after using `C^c` in Windows 11
- Segmentation fault at address 0x0 HOT 2
- Crash while installing package
- Bun v1.1.12: does not allocate SWAP, Uses memory till panic HOT 1
- Running `bun bun.lockb` crashes on certain repo's
- `bun update` removes comments in package.json HOT 1
- [win] SegFault HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bun.