Skip to content

docusaurus doesn't run on bun #9294

Closed as not planned
Closed as not planned

Description

@noraj

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.

Activity

  1. added
    bugAn error in the Docusaurus core causing instability or issues with its execution
    status: needs triageThis issue has not been triaged by maintainers
    on Sep 9, 2023
  2. Josh-Cena commented on Sep 9, 2023

    @Josh-Cena
    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.

  3. added
    closed: duplicateThis issue or pull request already exists in another issue or pull request
    and removed
    bugAn error in the Docusaurus core causing instability or issues with its execution
    status: needs triageThis issue has not been triaged by maintainers
    on Sep 9, 2023
  4. noraj commented on Sep 9, 2023

    @noraj
    ContributorAuthor

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

  5. Josh-Cena commented on Sep 10, 2023

    @Josh-Cena
    Collaborator

    Responded in oven-sh/bun#4742.

  6. slorber commented on Sep 11, 2023

    @slorber
    Collaborator

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

  7. slorber commented on Sep 12, 2023

    @slorber
    Collaborator

    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

  8. noraj commented on Sep 12, 2023

    @noraj
    ContributorAuthor

    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.

  9. slorber commented on Sep 13, 2023

    @slorber
    Collaborator

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    closed: duplicateThis issue or pull request already exists in another issue or pull request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions