Skip to content

VSCode extension fails to compile projects in windows #1813

Closed

Description

@moker-spaghetti

Expected Behavior

VSCode compile should work when dataform compile runs successfully on the normal terminal.

Current Behavior

Dataform language server crashes with the output below.

Error: spawn EINVAL
    at ChildProcess.spawn (node:internal/child_process:421:11)
    at Object.spawn (node:child_process:799:9)
    at compileAndValidate (c:\Users\moker\.vscode\extensions\dataform.dataform-0.0.15\server.js:45:44)
    at c:\Users\moker\.vscode\extensions\dataform.dataform-0.0.15\server.js:24:15 {
  errno: -4071,
  code: 'EINVAL',
  syscall: 'spawn'
}

Possible Solution

This might be caused by Node.js security update which disabled *.cmd file spawn without { shell: true }.
The updated Node.js has been shipped with VSCode = v1.92 or above.
Adding { shell: true } option might solve this issue, but the security aspect should be discussed.

Environment

OS: Win11
dataformCoreVersion: 3.0.0
Dataform CLI version: 3.0.0
VSCode version: 1.92.2
VSCode extension version: 0.0.15

Activity

  1. Ekrekr commented on Aug 28, 2024

    @Ekrekr
    Contributor

    Thanks for debugging this! It should be fine to pass { shell: true } - I don't think we have an alternative way to do this anyway.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions