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

fix(vite): Fix environment variable loading issue for Windows #545

Merged
merged 2 commits into from
Jun 10, 2024

Conversation

Rassilion
Copy link
Contributor

@Rassilion Rassilion commented Jun 6, 2024

This PR fixes an error that occurs when running the "vite" command on some Windows machines (We encountered this issue on 2 out of 5 of our Windows development environments, I'm not sure whats effecting it). The issue and its solution are detailed in vitest-dev/vitest#1870 (comment)

Applied the fix on affected Windows machines; the error did not reoccur.

Example output of the error;

Windows 11
node 22.2.0
vite 5.2.12
@sentry/vite-plugin 2.18.0

node:events:498
      throw er; // Unhandled 'error' event
      ^

Error: spawn undefined\System32\WindowsPowerShell\v1.0\powershell ENOENT
    at ChildProcess._handle.onexit (node:internal/child_process:286:19)
    at onErrorNT (node:internal/child_process:484:16)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
Emitted 'error' event on ChildProcess instance at:
    at ChildProcess._handle.onexit (node:internal/child_process:292:12)
    at onErrorNT (node:internal/child_process:484:16)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
  errno: -4058,
  code: 'ENOENT',
  syscall: 'spawn undefined\\System32\\WindowsPowerShell\\v1.0\\powershell',
  path: 'undefined\\System32\\WindowsPowerShell\\v1.0\\powershell',
  spawnargs: [
    '-NoProfile',
    '-NonInteractive',
    '–ExecutionPolicy',
    'Bypass',
    '-EncodedCommand',
    'UwB0AGEAcgB0ACAAIgBoAHQAdABwADoALwAvAGwAbwBjAGEAbABoAG8AcwB0ADoAMwAwADAAMAAvACIA'
  ]
}

@Rassilion Rassilion changed the title Windows PowerShell error fix fix(core): Environment Variable Loading Issue for Windows Jun 6, 2024
Copy link
Member

@lforst lforst left a comment

Choose a reason for hiding this comment

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

Thank you!

@lforst lforst changed the title fix(core): Environment Variable Loading Issue for Windows fix(vite): Fix environment variable loading issue for Windows Jun 10, 2024
@lforst lforst enabled auto-merge (squash) June 10, 2024 08:01
@lforst lforst merged commit 6244ac9 into getsentry:main Jun 10, 2024
16 checks passed
This was referenced Sep 21, 2024
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.

2 participants