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

support node:inspector #2445

Open
ivawzh opened this issue Mar 21, 2023 · 10 comments
Open

support node:inspector #2445

ivawzh opened this issue Mar 21, 2023 · 10 comments
Labels
enhancement New feature or request node.js Compatibility with Node.js APIs

Comments

@ivawzh
Copy link

ivawzh commented Mar 21, 2023

What is the problem this feature would solve?

Due to lacking support of node:inspector, our bun projects cannot support typedoc. This is very troubling as we own a significant amount of repos and rely on typedoc to generate all-in-one documentation.

What is the feature you are proposing to solve the problem?

Support inspector or having alternative way to walk around.

What alternatives have you considered?

No response

@ivawzh ivawzh added the enhancement New feature or request label Mar 21, 2023
@Electroid
Copy link
Contributor

Electroid commented Mar 21, 2023

We do plan on having a better debugging experience, which might include node:inspector. However, for typedoc, it looks like it's just doing a simple see if it's in debug mode.

import { url } from "inspector";
// ...
const isDebugging = () => !!url();

Code

In the interim, we should consider adding a no-op polyfill. cc @Jarred-Sumner

AminoffZ added a commit to AminoffZ/github-repo-size that referenced this issue Oct 1, 2023
I know this is a mess of lockfiles, should be fine once we get oven-sh/bun#2445
@Electroid Electroid added the node.js Compatibility with Node.js APIs label Oct 25, 2023
@klippx
Copy link

klippx commented Nov 7, 2023

@Electroid I want to flag another possible use case for something similar to node:inspector. As discussed in this thread we are interested in exposing the length of the runtime micro task queue as a metric for our app.

As an orthogonal task to this we are also looking into Bun.

So... Marrying the two concepts here: Is there a way to do what we want in Bun today? Perhaps via some 'bun:inspector' API, or via JavaScriptCore directly perhaps?

@mProjectsCode
Copy link

Is it possible to write a polyfill for it so that i can use typedoc with bun or is this something that needs to be fixed on buns side?

@klippx
Copy link

klippx commented Nov 14, 2023

In our case we have decided against this feature as it was a significant cost to scan the JS heap looking for promises. It was so slow there is no way we can afford to run it in prod.

Now, if there was a simple atomic counter counting the promises in the micro task queue that would be much more efficient. IDK how feasible that would be.

@BeatsuDev
Copy link

This error comes up when trying to run vite --profile too.

@Robbson
Copy link

Robbson commented Jan 18, 2024

I also get this error when trying to compile my docs via Typedoc.

@NoNameLmao
Copy link

+1, same with @pm2/io

@pragmatta
Copy link

Also hit this trying to use typedoc.

@yus-ham
Copy link
Contributor

yus-ham commented May 14, 2024

From pm2 log-rotate

NotImplementedError: node:inspector Session is not yet implemented in Bun. Track the status & thumbs up the issue: https://github.com/oven-sh/bun/issues/2445
 code: "ERR_NOT_IMPLEMENTED"

      at new NotImplementedError (internal:shared:19:27)
      at internal:shared:2:69
      at new Session (node:inspector:13:27)
      at init (/home/portal/.bun/install/global/node_modules/@pm2/io/build/main/services/inspector.js:13:24)
      at init (/home/portal/.bun/install/global/node_modules/@pm2/io/build/main/pmx.js:77:13)
      at /home/portal/.bun/install/global/node_modules/@pm2/io/build/main/index.js:5:45
      at injectModules (/home/portal/.bun/install/global/node_modules/pm2/lib/ProcessUtils.js:6:13)
      at /home/portal/.bun/install/global/node_modules/pm2/lib/ProcessContainerFork.js:9:1

Bun v1.1.7-canary.1+bbb906c66 (Linux x64 baseline)

@0pilatos0
Copy link

also running into this issue with vitest ui mode


⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Unhandled Error ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯NotImplementedError: node:inspector is not yet implemented in Bun. Track the status & thumbs up the issue: https://github.com/oven-sh/bun/issues/2445
 ❯ new ::bunternal:: internal:shared:19:14
 ❯ ::bunternal:: internal:shared:2:35
 ❯ new ::bunternal:: node:inspector:13:14
 ❯ module code node_modules/@vitest/coverage-v8/dist/index.js:4:17

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯Serialized Error: { code: 'ERR_NOT_IMPLEMENTED', originalLine: 19, originalColumn: 14, line: 19, column: 14, sourceURL: 'internal:shared' }



Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request node.js Compatibility with Node.js APIs
Projects
None yet
Development

No branches or pull requests

10 participants