Skip to content

Bug report: Export of Power app failed because of error : "Error: Cannot read properties of undefined (reading 'replace')" #6215

@NGseb

Description

@NGseb

Priority

(Medium) I'm annoyed but I'll live

Description

When using m365 pa app export version v8.0.0 it always fail with the error : Error: Cannot read properties of undefined (reading 'replace')
However, using the --debug, i can see sometimes the operation succeed with the download link.
So, as a workaround to download the package, i use the following Powershell code :
m365 pa app export --name $AppId -e $environment --path $exportPath --output 'json' --debug *> "$exportPath\$appId-debug.json" if (Test-Path "$exportPath\$appId-debug.json") { $res=Select-String -Path "$exportPath\$appId-debug.json" -Pattern 'https://bapfeblob?????.blob.core.windows.net?' if ($res.LineNumber -gt 0) { $url=$res.Line.replace('"','').replace(" value: ","") Invoke-WebRequest -Uri $url -OutFile "$exportPath\$appId-$filename.zip" } }

Steps to reproduce

m365 pa app export --name $AppId -e $environment --path $exportPath --output 'json'

Expected results

We should have the export downloaded directly.

Actual results

no file are created a,nd the command always fails.

Diagnostics

Using --debug, i can see in the debug information :
Current status of the get package link: Succeeded

Timings:
api: 6200.5192ms
core: 15.5042ms
command: 21250.634ms
options: 0.5032ms
total: 21267.9991ms
validation: 1.4119ms
Error: Cannot read properties of undefined (reading 'replace')

CLI for Microsoft 365 version

8.0.0

nodejs version

v20.16.0

Operating system (environment)

Windows

Shell

Windows PowerShell

cli doctor

No response

Additional Info

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions