getsentry / sentry-wizard

Sentry Project Setup Wizard
MIT License
192 stars 48 forks source link

Running the Wizard with Bun #446

Closed HazAT closed 5 months ago

HazAT commented 1 year ago

If I run a local build of the Wizard with Bun 1.0 it works

Mostly - there is an issue with clack where it gets stuck in project selection suddenly stops taking input

image

https://github.com/natemoo-re/clack/issues/159

when I run it with npx bunx @sentry/wizard@latest

I get an error

/private/tmp/@sentry/wizard@latest--bunx/node_modules/r2/index.js:4
  global.fetch = require('node-fetch')
                 ^

Error [ERR_REQUIRE_ESM]: require() of ES Module /private/tmp/@sentry/wizard@latest--bunx/node_modules/r2/node_modules/node-fetch/src/index.js from /private/tmp/@sentry/wizard@latest--bunx/node_modules/r2/index.js not supported.
Instead change the require of /private/tmp/@sentry/wizard@latest--bunx/node_modules/r2/node_modules/node-fetch/src/index.js in /private/tmp/@sentry/wizard@latest--bunx/node_modules/r2/index.js to a dynamic import() which is available in all CommonJS modules.
    at Object.<anonymous> (/private/tmp/@sentry/wizard@latest--bunx/node_modules/r2/index.js:4:18)
    at Object.<anonymous> (/private/tmp/@sentry/wizard@latest--bunx/node_modules/@sentry/wizard/dist/lib/Steps/OpenSentry.js:62:10)
    at Object.<anonymous> (/private/tmp/@sentry/wizard@latest--bunx/node_modules/@sentry/wizard/dist/lib/Steps/index.js:6:20)
    at Object.<anonymous> (/private/tmp/@sentry/wizard@latest--bunx/node_modules/@sentry/wizard/dist/lib/Setup.js:87:25)
    at Object.<anonymous> (/private/tmp/@sentry/wizard@latest--bunx/node_modules/@sentry/wizard/dist/bin.js:28:15) {
  code: 'ERR_REQUIRE_ESM'
}

Node.js v20.2.0
error: "sentry-wizard" exited with code 1 (SIGHUP)
Lms24 commented 1 year ago

I just tried bunx @sentry/wizard@latest and with the sourcemaps wizard flow, setting up the Vite plugin in a Vite+React app. No error message so far 🤔 Does this still happen with bun@1.0.1?

AbhiPrasad commented 1 year ago

The bun wizard should add @sentry/cli to package.json trusted dependencies. https://bun.sh/docs/cli/install#trusted-dependencies

See https://github.com/getsentry/sentry-javascript-bundler-plugins/issues/412

Lms24 commented 1 year ago

@AbhiPrasad good point, opened a separate issue to track.

github-actions[bot] commented 1 year ago

This issue has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you label it Status: Backlog or Status: In Progress, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

HazAT commented 1 year ago

bad bot

Lms24 commented 1 year ago

@HazAT is this still an issue? I couldn't reproduce it back then and the trustedDependencies task is tracked separately in #476.

HazAT commented 11 months ago

I haven't tried it tbh - someone just needs to run the wizard with Bun - but let's close it and see if it comes up again

braydend commented 7 months ago

I'm still having this issue. I was able to run npx @sentry/wizard@latest -i sveltekit (Node v21) as a workaround and it seems to have worked

Lms24 commented 7 months ago

@braydend thanks for letting us know! Did you run the wizard with the latest bun version?

braydend commented 7 months ago

@braydend thanks for letting us know! Did you run the wizard with the latest bun version?

These are the versions I am using: Bun: 1.0.2 Sveltekit: ^2.0.0 Svelte: 5.0.0-next.33

Lms24 commented 7 months ago

Can you try updating Bun to the latest version? According to https://github.com/natemoo-re/clack/issues/170#issuecomment-1857101917 there was a bug that might be causing the issue and it was fixed in Bun 1.0.18.

HazAT commented 5 months ago

tried it with Bun 1.1.8 and latest version of the wizard - it works now