Power-Maverick / DataverseDevTools-VSCode

The all-in-one tool to develop code for Dataverse/Dynamics 365. Helps you connect to a Dataverse environment, generate TypeScript definitions for entities, create a different type of Dataverse-specific projects, and much more.
https://marketplace.visualstudio.com/items?itemName=danish-naglekar.dataverse-devtools
MIT License
58 stars 15 forks source link

[Bug]: Error in uploadWebResource #189

Closed erickalves05 closed 1 week ago

erickalves05 commented 1 week ago

What happened?

An error occurred in a specific project after trying to upload an existing JS resource to Dataverse. With other projects the upload/publish are successful.

The only difference between them is that the non-working project has file names starting with a lowercase letter.

Reverting to the previous extension version makes it work.

Thanks for this extension.

What version of the tool are you using?

v2.2.1

What version of Visual Studio Code are you running?

1.95.2

Any relevant session id from VSCode?

d3aa21b3-556c-46fc-a9b2-3a47ce1e38e81731593611770

Relevant log output

VSCode version: 1.95.2. 
Extension version: 2.2.1. 
Error occured in uploadWebResource command. 
Error code: undefined. 
Error message: Cannot set properties of undefined (setting '@_version'). 
Error stack: TypeError: Cannot set properties of undefined (setting '@_version')
    at t.xmlToJSON (c:\Users\erick\.vscode\extensions\danish-naglekar.dataverse-devtools-2.2.1\dist\extension.js:2:801897)
    at t.WebResourceHelper.<anonymous> (c:\Users\erick\.vscode\extensions\danish-naglekar.dataverse-devtools-2.2.1\dist\extension.js:2:762308)
    at Generator.next (<anonymous>)
    at o (c:\Users\erick\.vscode\extensions\danish-naglekar.dataverse-devtools-2.2.1\dist\extension.js:2:751513).
power-maverick-bot[bot] commented 1 week ago

Thanks for raising an issue. Please make sure you have given us as much context as possible. One of the repo maintainer will respond as soon as possible.

erickalves05 commented 1 week ago

Based on this issue I narrowed the problem down to it being that my old project was created with another extension version, which didn't include the "<?xml />" tag in the dvdt.linker.xml file.

After adding that the old project started working with the latest version (v2.2.1).

Thanks.