Skip to content
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

docusaurus doesn't run on bun #9294

Closed
3 of 7 tasks
noraj opened this issue Sep 9, 2023 · 7 comments
Closed
3 of 7 tasks

docusaurus doesn't run on bun #9294

noraj opened this issue Sep 9, 2023 · 7 comments
Labels
closed: duplicate This issue or pull request already exists in another issue or pull request

Comments

@noraj
Copy link
Contributor

noraj commented Sep 9, 2023

Have you read the Contributing Guidelines on issues?

Prerequisites

  • I'm using the latest version of Docusaurus.
  • I have tried the npm run clear or yarn clear command.
  • I have tried rm -rf node_modules yarn.lock package-lock.json and re-installing packages.
  • I have tried creating a repro with https://new.docusaurus.io.
  • I have read the console error message carefully (if applicable).

Description

The current architecture is so that docusaurus requires nodejs to run while it could easily run on other javascript servers like bun.

Reproducible demo

No response

Steps to reproduce

  • bun x create-docusaurus@latest my-website classic
  • cd my-website
  • bun install
  • bun run docusaurus

Expected behavior

Working with bun as well with nodejs

Actual behavior

➜ bun run docusaurus
$ docusaurus
 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 /tmp/my-website/node_modules/parent-module/index.js:14:1
      at /tmp/my-website/node_modules/import-fresh/index.js:11:20
      at /tmp/my-website/node_modules/@docusaurus/core/lib/server/config.js:36:10
      at processTicksAndRejections (:1:2602)
error: script "docusaurus" exited with code 1 (SIGHUP)

Your environment

  • Docusaurus version used: 2.4.1
  • Environment name and version : bun 1.0.0
  • Operating system and version : archlinux

Self-service

  • I'd be willing to fix this bug myself.
@noraj noraj added bug An error in the Docusaurus core causing instability or issues with its execution status: needs triage This issue has not been triaged by maintainers labels Sep 9, 2023
@Josh-Cena
Copy link
Collaborator

Your error stack references Node, so not sure how it's related to bun. This error is a duplicate of #9291 and fixed by the latest Node.

@Josh-Cena Josh-Cena closed this as not planned Won't fix, can't repro, duplicate, stale Sep 9, 2023
@Josh-Cena Josh-Cena added closed: duplicate This issue or pull request already exists in another issue or pull request and removed bug An error in the Docusaurus core causing instability or issues with its execution status: needs triage This issue has not been triaged by maintainers labels Sep 9, 2023
@noraj
Copy link
Contributor Author

noraj commented Sep 9, 2023

@Josh-Cena Sorry, it was an error of environment. I modified my original message with a reproducible clean environment.

@Josh-Cena
Copy link
Collaborator

Responded in oven-sh/bun#4742.

@slorber
Copy link
Collaborator

slorber commented Sep 11, 2023

There's a dedicated Bun issue there, let's use it: oven-sh/bun#3426

@slorber
Copy link
Collaborator

slorber commented Sep 12, 2023

For reference this is why we use the Bun issue instead of the Docusaurus issue:

CleanShot 2023-09-12 at 18 32 58@2x

https://twitter.com/jarredsumner/status/1700497869160268155

@noraj
Copy link
Contributor Author

noraj commented Sep 12, 2023

I agree with you and I'm sorry for opening this issue there.

What's deceptive and misleading is the release of Bun v1.0.0. Normally following semver 0.x.x are kind of unstable version while 1.0.0 means the 1st stable version. When I saw and tested v1 I expected Bun to be production ready while in fact it's still in beta since they claim to want full Node.js compatibility and in v1 the Node.js compatibility is still vastly incomplete https://bun.sh/docs/runtime/nodejs-apis.

So yeah most errors come from the fact that the Node.js compatibility is not 100% yet and not because upstream project have hard-coded nodejs stuff.

@slorber
Copy link
Collaborator

slorber commented Sep 13, 2023

Not sure it's their fault, it's also because Docusaurus uses a package that depends on V8

CleanShot 2023-09-13 at 18 09 59@2x

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed: duplicate This issue or pull request already exists in another issue or pull request
Projects
None yet
Development

No branches or pull requests

3 participants