Skip to content

pac code add-data-source fails on macOS with spaces in path #1285

@djpetersen2015

Description

@djpetersen2015

The pac code add-data-source command fails on macOS when the VS Code extension installs pac CLI to the default location containing spaces: /Users/[username]/Library/Application Support/...

Node.js cannot parse the path correctly and throws "Cannot find module '/Users/[username]/Library/Application'" (truncated at the space).

Steps to Reproduce:

  1. Install Power Platform Tools VS Code extension on macOS
  2. Navigate to a Power Apps Code App project
  3. Run: pac code add-data-source -a shared_commondataserviceforapps -c [connectionId] -t task

Expected Behavior:
Command executes successfully and adds the data source to the project.

Actual Behavior:
Command fails with error: "Cannot find module '/Users/[username]/Library/Application'"

Environment:

  • OS: macOS (Sonoma/Sequoia)
  • pac CLI: Version 1.51.1 (via VS Code extension)
  • Node.js: v24.2.0
  • VS Code: 1.107.0 (Universal)
  • Extension: Power Platform Tools

Workaround:
Run the command on Windows and copy the generated files to macOS.

Root Cause:
The path /Users/[username]/Library/Application Support/ contains a space, which Node.js fails to handle properly when the VS Code extension invokes pac CLI.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions