-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support Docusaurus #3426
Comments
9 | }
10 |
11 | let seenVal = false;
12 |
13 | // Skip the first stack as it's this function
14 | stacks.shift();
^
TypeError: stacks.shift is not a function. (In 'stacks.shift()', 'stacks.shift' is undefined)
at /Users/admin/repos/docusaurus-test/docusaurus/node_modules/parent-module/index.js:14:1
at /Users/admin/repos/docusaurus-test/docusaurus/node_modules/import-fresh/index.js:11:20
at /Users/admin/repos/docusaurus-test/docusaurus/node_modules/@docusaurus/core/lib/server/config.js:36:10 Blocked by |
With the stack.shift issue fixed, I now see this:
TypeError: client.terminate is not a function. (In 'client.terminate()', 'client.terminate' is undefined)
at /Users/admin/repos/docusaurus-test/docusaurus/node_modules/webpack-dev-server/lib/servers/WebsocketServer.js:70:12
at forEach (:1:20)
at /Users/admin/repos/docusaurus-test/docusaurus/node_modules/webpack-dev-server/lib/servers/WebsocketServer.js:64:6
65 | /**
66 | * @param {ClientConnection} client
67 | */
68 | (client) => {
69 | if (client.isAlive === false) {
70 | client.terminate();
^
➜ bun --bun run build
error: Cannot find module "/Users/admin/repos/docusaurus-test/docusaurus/build" from "bun:main" |
I'm seeing the |
I tried this with the new docusaurus 3.0.1, and while I still get these server errors, the localhost site does launch properly: TypeError: client.ping is not a function. (In 'client.ping(() => {
})', 'client.ping' is undefined)
at /Users/admin/repos/bun-kitchensink/docusaurus/node_modules/webpack-dev-server/lib/servers/WebsocketServer.js:76:11
at forEach (:1:21)
at /Users/admin/repos/bun-kitchensink/docusaurus/node_modules/webpack-dev-server/lib/servers/WebsocketServer.js:64:7
65 | /**
66 | * @param {ClientConnection} client
67 | */
68 | (client) => {
69 | if (client.isAlive === false) {
70 | client.terminate();
^
TypeError: client.terminate is not a function. (In 'client.terminate()', 'client.terminate' is undefined)
at /Users/admin/repos/bun-kitchensink/docusaurus/node_modules/webpack-dev-server/lib/servers/WebsocketServer.js:70:13
at forEach (:1:21)
at /Users/admin/repos/bun-kitchensink/docusaurus/node_modules/webpack-dev-server/lib/servers/WebsocketServer.js:64:7
65 | /**
66 | * @param {ClientConnection} client
67 | */
68 | (client) => {
69 | if (client.isAlive === false) {
70 | client.terminate();
^
|
Does anyone know what the remaining issues are? It seems that some of the original linked issues have been fixed, we're still not in a working state - so is it not known what the remaining issues are? |
I found this myself, and (seems like incorrectly) reported the bug in webpack Then researched some more and landed on this issue ✔ Client
Compiled successfully in 9.78s
client (webpack 5.89.0) compiled successfully
71 |
72 | return;
73 | }
74 |
75 | client.isAlive = false;
76 | client.ping(() => {});
^
TypeError: client.ping is not a function. (In 'client.ping(() => {
})', 'client.ping' is undefined)
at /ssd/dev/t/web/docutest/node_modules/webpack-dev-server/lib/servers/WebsocketServer.js:76:11
at forEach (:1:21)
at /ssd/dev/t/web/docutest/node_modules/webpack-dev-server/lib/servers/WebsocketServer.js:64:7
65 | /**
66 | * @param {ClientConnection} client
67 | */
68 | (client) => {
69 | if (client.isAlive === false) {
70 | client.terminate();
^ |
Found something else. |
@Electroid I'm the Docusaurus maintainer and don't know Bun much. To me it looks like Logging When I try While the following works: (latest Bun v1.0.26) |
You're right. You can force usage of bun with the |
Thanks
If that helps, here's a more meaningful error message/stacktrace: We are doing SSR/SSG using |
@slorber Got it, thanks for flagging that. We have some more work to do then |
Thanks for investigating @Electroid I'm excited to see Bun support for Docusaurus happening 👍 Here's a minimal repro of the problem we encounter while rendering static pages of Docusaurus inside https://github.com/slorber/bun-docusaurus-ssg-repro const eval = require("eval");
const fs = require("fs");
async function run() {
const fileContent = await fs.promises.readFile("server.bundle.js")
console.log("fileContent",fileContent)
const result = eval(
fileContent,
/* filename: */ "server.bundle.js",
/* scope: */ {},
/* includeGlobals: */ true
)
console.log("result",result)
}
run() This runs in Node.js v20 but fails in Bun v1.0.26: Of course Apart from that issue, it seems that otherwise the Docusaurus init template is able to run under Bun, so it's probably the only remaining problem 👍 (I still have another issue on our own Docusaurus website, but will have to investigate this independently) |
Apparently, the issue above is caused by this very old Node.js "require-like" lib: Used internally in "node-eval", with pseudo-code such as: const sandbox = {require: requireLike(_filename)}
vmScript.runInNewContext(sandbox,options) https://github.com/pierrec/node-eval/blob/master/eval.js I thought you'd find this useful, but I'll also try to see on my side if we can get rid of it. Problematic code in that lib: var Module = require('module');
Module._load(file, parentModule); Related Bun bug: #5925 Edit: tried to replace this old error: script "docusaurus" was terminated by signal SIGSEGV (Address boundary error)
zsh: segmentation fault bun --bun run docusaurus build This time I'm not sure how to troubleshoot that 😅 I also saw these warnings:
|
I have Problem, Install bun Docusaurus and bun start Bun version 1.0.30 Error:
|
Just tried v1.1 and Docusaurus still can't build. I get an error due to unimplemented Disabling modification gets me further until it segfaults during SSG:
Looks like it's still not working, similarly to my previous test here: #3426 (comment) |
It seems to work now for what it's worth. I had no issues with building with |
I believe this is the same issue as: #11539 |
I also see it working now, but we still need to use
When using that option, I'm able to build a newly initialized site with BenchmarkSurprisingly, it builds slower than Node 22.3: Node 22hyperfine --runs 5 'yarn clear && yarn build --no-minify'
Benchmark 1: yarn clear && yarn build --no-minify
Time (mean ± σ): 7.716 s ± 0.080 s [User: 9.871 s, System: 2.259 s]
Range (min … max): 7.582 s … 7.793 s 5 runs Bun 1.1.22hyperfine --runs 5 'bun --bun run docusaurus clear && bun --bun run docusaurus build --no-minify'
Benchmark 1: bun --bun run docusaurus clear && bun --bun run docusaurus build --no-minify
Time (mean ± σ): 8.657 s ± 0.078 s [User: 12.067 s, System: 1.109 s]
Range (min … max): 8.584 s … 8.785 s 5 runs |
bun new version 1.1.26 works. use powershell |
If anything, Bun v1.1.26 is a step back in my testing. It segfaults when running |
What version of Bun is running?
0.6.10
What platform is your computer?
ubuntu 22.04
What steps can reproduce the bug?
bunx --bun create-docusaurus@latest docusaurus
What is the expected behavior?
No response
What do you see instead?
found two bug here, one is the selection is not interactive, try using up, down key instead shows
^[[B^[[A
and another else the error in the bottom
Additional information
No response
The text was updated successfully, but these errors were encountered: