Skip to content

Formatting fails for justfiles that import from node_modules #93

@PaulRBerg

Description

@PaulRBerg

Problem

The extension's format command fails when the justfile contains an import statement pointing to a file inside node_modules. The formatter runs just --dump under the hood, and just can't resolve the imported path because the extension doesn't run the command from the workspace root (or just itself doesn't search node_modules).

Error from the output channel:

[2026-02-17T12:24:31.073Z] [error] Error formatting justfile:
Command failed: just --dump
error: Could not find source file for import.
 ——▶ justfile:2:8
  │
2 │ import "./node_modules/@sablier/devkit/just/base.just"
  │        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

The import path is valid and just --dump works fine when run manually from the terminal in the same directory.

Image

Expected Behavior

The formatter should succeed when just --dump works in the terminal — i.e., the extension should run the command from the workspace root so that relative import paths resolve correctly.

Environment

  • VS Code: latest
  • Extension version: latest
  • OS: macOS Tahoe v26.3
  • just version: 1.40.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions