Skip to content

fix: Fix spawn ENOENT for vite integration#1556

Closed
alexgrozav wants to merge 1 commit into
getsentry:masterfrom
alexgrozav:patch-1
Closed

fix: Fix spawn ENOENT for vite integration#1556
alexgrozav wants to merge 1 commit into
getsentry:masterfrom
alexgrozav:patch-1

Conversation

@alexgrozav
Copy link
Copy Markdown

Fixes vite plugin integration error.

alexgrozav@Alexs-MacBook-Pro editor-ui % pnpm run build

> n8n-editor-ui@0.188.0 build /Users/alexgrozav/Workspace/n8n/n8n/packages/editor-ui
> cross-env NODE_OPTIONS="--max-old-space-size=8192" vite build

node:internal/errors:478
    ErrorCaptureStackTrace(err);
    ^

Error: spawn /Users/alexgrozav/Workspace/n8n/n8n/node_modules/.pnpm/@sentry+cli@2.16.1/node_modules/@sentry/cli/sentry-cli ENOENT
    at Process.ChildProcess._handle.onexit (node:internal/child_process:285:19)
    at onErrorNT (node:internal/child_process:485:16)
    at processTicksAndRejections (node:internal/process/task_queues:83:21) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'spawn /Users/alexgrozav/Workspace/n8n/n8n/node_modules/.pnpm/@sentry+cli@2.16.1/node_modules/@sentry/cli/sentry-cli',
  path: '/Users/alexgrozav/Workspace/n8n/n8n/node_modules/.pnpm/@sentry+cli@2.16.1/node_modules/@sentry/cli/sentry-cli',
  spawnargs: [ 'releases', 'propose-version' ],
  cmd: '/Users/alexgrozav/Workspace/n8n/n8n/node_modules/.pnpm/@sentry+cli@2.16.1/node_modules/@sentry/cli/sentry-cli releases propose-version'
}

@kamilogorek
Copy link
Copy Markdown
Contributor

This path is the same one that we use for https://github.com/getsentry/sentry-cli/blob/master/scripts/install.js script, so I'm not sure how that change would make a difference tbh.
This looks like an issue with running (possibly caching a result?) of postinstall script, which produces the binary itself, which is then not present during execution.
Do you have a repro repository that we could use to debug this?

@alexgrozav
Copy link
Copy Markdown
Author

@kamilogorek You can find the exact usage here: https://github.com/n8n-io/n8n/pull/5870/files

I had to patch the package in order to get it to work. Perhaps could have something to do with the fact that it's a monorepo? I'm not entirely sure, but it's worth looking into.

Comment thread js/helper.js
@@ -15,6 +15,7 @@ function getBinaryPath() {
const parts = [];
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we use require.resolve instead here, like this:

path.join(require.resolve('@sentry/cli'), `../../bin/sentry-cli${process.platform === 'win32' ? '.exe' : ''}`)

Copy link
Copy Markdown
Contributor

@kamilogorek kamilogorek Apr 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, unfortunately, we specifically cannot use require.resolve due to @vercel/nft behavior.

See #1207 and a follow-up in #1374

@kamilogorek
Copy link
Copy Markdown
Contributor

Perhaps could have something to do with the fact that it's a monorepo? I'm not entirely sure, but it's worth looking into.

Yes, that's most likely it, as it's making links between shared packages in the root directory. I'm out for the next few weeks, but will keep that issue in mind.

@github-actions
Copy link
Copy Markdown
Contributor

This pull request 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 🥀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants