Skip to content

v1.0.201

Choose a tag to compare

@github-actions github-actions released this 06 May 15:58
· 106 commits to main since this release

🐛 Fix: chip view server-side createRequire is not a function

v1.0.200's webpack DefinePlugin killed the spurious createRequire call in the browser bundle, but the same error then surfaced server-side when opening 代码块 / Code Map:

[projectGraph/file-functions] failed: TypeError: createRequire is not a function

web-tree-sitter's ESM bundle does await import("module") inside its Node-detection branch. With the package bundled into Next.js's server chunks, import("module") was getting rewritten as __webpack_require__.t.bind(...) — webpack's namespace wrapper for a Node-builtin shim doesn't preserve enumerable static properties cleanly across mode-19 dynamic imports, so destructuring { createRequire } yielded undefined.

Fix: add web-tree-sitter to serverExternalPackages so it's loaded at runtime via Node's actual ESM resolver. import("module") then hits node:module directly and createRequire is the real Node function. The browser-side dead-code fix from v1.0.200 stays in place; both sides now correct independently.

npm install -g @surething/cockpit@latest