OpenRAG Version
0.5.0
Deployment Method
Local development (make dev)
Operating System
Linux ppc64le
Python Version
No response
Affected Area
Frontend (Next.js UI, components)
Bug Description
next-swc has no prebuilt native bindings for linux/ppc64le. This causes two failures: (1) __dirname inside next.config.ts resolves incorrectly under the WASM fallback, breaking .env loading; (2) Turbopack (the default bundler) requires native SWC and fails on ppc64le. The fix adds an arch-detection wrapper (build.js) that forces --webpack on ppc64le, updates the build script to invoke it, and fixes the env path to use process.cwd() instead of __dirname.
Steps to Reproduce
- Set up a
linux/ppc64le host (IBM Power machine)
- Clone the repository and
cd into it
- Copy
.env.example to .env and fill in required values
For the build failure (npm run build / make dev):
4. cd frontend && npm ci
5. Run npm run build (pre-fix, calls next build directly)
For the dev server failure (make frontend)
4. Run make frontend from the repo root
Expected Behavior
Frontend builds and dev server start successfully on ppc64le.
Actual Behavior
-
npm run build fails — Turbopack cannot initialize without native next-swc bindings for ppc64le; next.config.ts fails to load .env because __dirname resolves to Next.js internals under the WASM runtime instead of the project root
-
make frontend fails — npx next dev attempts to use Turbopack (default), which requires native SWC bindings unavailable on ppc64le
Relevant Logs
make frontend logs (pre-fix):
▲ Next.js 16.2.9 (Turbopack)
- Local: http://localhost:3000
- Network: http://0.0.0.0:3000
✓ Ready in 625ms
⚠ next-swc does not have native bindings for platform linux/ppc64. Native features like Turbopack will not be available.
Using cached swc package @next/swc-wasm-nodejs...
⨯ Failed to load next.config.ts, see more info here https://nextjs.org/docs/messages/next-config-error
ReferenceError: __dirname is not defined in ES module scope
at <unknown> (next.config.compiled.js:7:24)
make: *** [Makefile:728: frontend] Error 1
npm run build logs (pre-fix):
> frontend@0.1.0 build
> next build
⚠ next-swc does not have native bindings for platform linux/ppc64. Native features like Turbopack will not be available.
Using cached swc package @next/swc-wasm-nodejs...
⨯ Failed to load next.config.ts, see more info here https://nextjs.org/docs/messages/next-config-error
> Build error occurred
ReferenceError: __dirname is not defined in ES module scope
at <unknown> (next.config.compiled.js:7:24)
npm run build logs (post-fix):
⚠ next-swc does not have native bindings for platform linux/ppc64. Native features like Turbopack will not be available.
Using cached swc package @next/swc-wasm-nodejs...
▲ Next.js 16.2.9 (webpack)
✓ Compiled successfully in 62s
Screenshots
No response
Additional Context
No response
Checklist
OpenRAG Version
0.5.0
Deployment Method
Local development (make dev)
Operating System
Linux ppc64le
Python Version
No response
Affected Area
Frontend (Next.js UI, components)
Bug Description
next-swchas no prebuilt native bindings forlinux/ppc64le. This causes two failures: (1)__dirnameinsidenext.config.tsresolves incorrectly under the WASM fallback, breaking.envloading; (2) Turbopack (the default bundler) requires native SWC and fails on ppc64le. The fix adds an arch-detection wrapper (build.js) that forces--webpackon ppc64le, updates the build script to invoke it, and fixes the env path to useprocess.cwd()instead of__dirname.Steps to Reproduce
linux/ppc64lehost (IBM Power machine)cdinto it.env.exampleto.envand fill in required valuesFor the build failure (
npm run build/make dev):4.
cd frontend && npm ci5. Run
npm run build(pre-fix, callsnext builddirectly)For the dev server failure (
make frontend)4. Run
make frontendfrom the repo rootExpected Behavior
Frontend builds and dev server start successfully on ppc64le.
Actual Behavior
npm run build fails— Turbopack cannot initialize without nativenext-swcbindings for ppc64le;next.config.tsfails to load.envbecause __dirname resolves to Next.js internals under the WASM runtime instead of the project rootmake frontendfails — npx next dev attempts to use Turbopack (default), which requires native SWC bindings unavailable on ppc64leRelevant Logs
Screenshots
No response
Additional Context
No response
Checklist