Skip to content

[Bug] 'pac code add-data-source' fails on macOS due to pathsΒ #76

@TomProkop

Description

@TomProkop

Describe the bug

Probably wrong handling of paths in PAC CLI. Node.js fails fails with MODULE_NOT_FOUND error when trying to resolve a path containing spaces. The error shows Node.js is attempting to load a module from an incomplete path /Users/tomasprokop/Library/Application which appears to be truncated version of /Users/tomasprokop/Library/Application Support/ due to improper handling of spaces in the file path.

Steps to Reproduce

  1. Navigate to the repository root directory
  2. Run pac code run command pac code add-data-source -a dataverse -t <entityname>
  3. See error:
node:internal/modules/cjs/loader:1368
  throw err;
  ^

Error: Cannot find module '/Users/tomasprokop/Library/Application'
    at Function._resolveFilename (node:internal/modules/cjs/loader:1365:15)
    at defaultResolveImpl (node:internal/modules/cjs/loader:1021:19)
    at resolveForCJSWithHooks (node:internal/modules/cjs/loader:1026:22)
    at Function._load (node:internal/modules/cjs/loader:1175:37)
    at TracingChannel.traceSync (node:diagnostics_channel:322:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:235:24)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:171:5)
    at node:internal/main/run_main_module:36:49 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

Node.js v22.18.0

Screenshots or Error Messages

Image

Environment information

Framework, build tool or relevant package used: React, Vite, TypeScript
Power Apps Code SDK: 0.0.4
PAC CLI: Version: 1.47.1+gc5a7855
Node.js: v22.18.0
OS: macOS 15.6 (24G84)
Shell: zsh

Metadata

Metadata

Assignees

No one assigned

    Labels

    wontfixThis will not be worked on

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions