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

Running docusaurus with bun reports type errors #17920

Closed
heysokam opened this issue Jan 3, 2024 · 4 comments
Closed

Running docusaurus with bun reports type errors #17920

heysokam opened this issue Jan 3, 2024 · 4 comments
Labels

Comments

@heysokam
Copy link

heysokam commented Jan 3, 2024

Bug report

Trying to run bun start with docusaurus-latest works, but initially sends an error in console (likely unrelated to webpack) and then reports a second error about webpack's WebsocketServer.js in console repeatedly.

What is the current behavior?

 bun start
$ docusaurus start
[INFO] Starting the development server...
216 |                 Object.assign(this.options.headers, source.headers);
217 |             }
218 |         });
219 |         this.on('newListener', event => {
220 |             if (event === 'retry' && this.listenerCount('retry') > 0) {
221 |                 throw new Error('A retry listener has been attached already.');
                            ^
error: A retry listener has been attached already.
      at /ssd/dev/t/web/docutest/node_modules/got/dist/source/core/index.js:221:23
      at makeRequest (/ssd/dev/t/web/docutest/node_modules/got/dist/source/as-promise/index.js:107:13)
      at /ssd/dev/t/web/docutest/node_modules/got/dist/source/as-promise/index.js:125:9
      at /ssd/dev/t/web/docutest/node_modules/p-cancelable/index.js:63:4
      at new Promise (:1:21)
      at new PCancelable (/ssd/dev/t/web/docutest/node_modules/p-cancelable/index.js:31:19)
      at asPromise (/ssd/dev/t/web/docutest/node_modules/got/dist/source/as-promise/index.js:21:21)
      at lastHandler (/ssd/dev/t/web/docutest/node_modules/got/dist/source/create.js:42:27)
      at iterateHandlers (/ssd/dev/t/web/docutest/node_modules/got/dist/source/create.js:49:19)
[SUCCESS] Docusaurus website is running at: http://localhost:3000/

 Client █████████████████████████ building (46%) 2/3 entries 703/783 dependencies 157/248 modules 60 active
 mdx-loader  blog/2019-05-28-first-blog-post.md


 Client █████████████████████████ building (46%) 2/3 entries 710/787 dependencies 167/250 modules 65 active
 mdx-loader  docs/tutorial-basics/markdown-features.mdx

[WARNING] The image at "/ssd/dev/t/web/docutest/static/img/docusaurus.png" can't be read correctly. Please ensure it's a valid image.
handle.close is not a function. (In 'handle.close()', 'handle.close' is undefined)

 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();
                 ^

If the current behavior is a bug, please provide the steps to reproduce.

bun create docusaurus
... name it docutest
... pick js or ts, happens in both
cd docutest
bun start

What is the expected behavior?

Running the code with bun start shouldn't output type errors.

Other relevant information:
Webpack version: 5.89.0
Operating System: Linux (gentoo)
Additional tools: bun 1.0.20
Dependencies versions:

  "dependencies": {
    "@docusaurus/core": "3.0.1",
    "@docusaurus/preset-classic": "3.0.1",
    "@mdx-js/react": "^3.0.0",
    "clsx": "^2.0.0",
    "prism-react-renderer": "^2.3.0",
    "react": "^18.0.0",
    "react-dom": "^18.0.0"
  },
  "devDependencies": {
    "@docusaurus/module-type-aliases": "3.0.1",
    "@docusaurus/types": "3.0.1"
  },
@heysokam
Copy link
Author

heysokam commented Jan 3, 2024

Just as I finished writing this report I continued searching for more keywords.
Apparently there seems to be an ongoing thread about bun having issues with compatibility with some parts of nodejs.
Please close this issue, or @ me to close it, if it is not relevant to this repository.

@singhkaram
Copy link

assign to me, let me try to fix this issue

@alexander-akait
Copy link
Member

I think there is a bug on the bun side

@alexander-akait
Copy link
Member

Close in favor oven-sh/bun#3426

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants