@fractality/mandelbrot is ESM and exports a default function. In CommonJS (require(...)), that comes back as a namespace object with a .default property, not a callable function directly. So old-style usage (const mandelbrot = require(...)) throws TypeError: mandelbrot is not a function; the interop line fixes this by using mandelbrotPackage.default || mandelbrotPackage.
— A.I.
npm view @fractality/mandelbrot dependencies peerDependencies --json
node -e "const m=require('@fractality/mandelbrot'); ..."
node -e "const mandelbrot=require('@fractality/mandelbrot'); mandelbrot({}) ..."
npm view @fractality/mandelbrot dependencies peerDependencies
--json
{
"dependencies": {
"js-beautify": "^1.15.1",
"lodash": "^4.17.21"
},
"peerDependencies": {
"@fractality/fractality": ">= 1.5 < 2"
}
}
$ node -e "const m=require(\"@fractality/mandelbrot\"); console
.log(Object.keys(m)); console.log(typeof m.default); console.lo
g(typeof m);"
[ '__esModule', 'default' ]
function
object
$ node -e "const mandelbrot=require(\"@fractality/mandelbrot\")
; try { mandelbrot({}); } catch (e) { console.log(e.toString())
; }"
TypeError: mandelbrot is not a function
Steps to reproduce the issue
Upgrade project from Fractal
v1.5to Fractalityv1.6.Notice it may addfs-extraas a dev dependency:(user error; fixed in TACC/Core-Styles#596)
Resolved / Nevermind
Start Fractality.
TypeError: mandelbrot is not a functionAdding
default-exportinterop infractality.config.jsfixed error.Details
Commands Run:
Captured Outputs:
Reproduces how often:
Each time I use wesleyboar/Core-Styles#2 without interop.
Reduced test case
Context
Fractality version:
Node version: v25.4.0
OS: macOS 15.7.4