dotnet / dotnet/sdk

Microsoft.VisualStudio.JavaScript.SDK fails to generate package.g.props and then to do npm run build

Open
#42,741 1 comment 0 reactions 0 assignees View on GitHub
Area-esproj untriaged
Dominant language
C#
Stars
3.2k
Forks
1.3k
PR merge metrics
PR metrics pending

Description

I don't know if this is the right place to report issues about `Microsoft.VisualStudio.JavaScript.SDK`... but i couldn't find any better place...

If package.json contains "similar" npm dependencies (similar in the sense that striping out non alphanumeric chars from their names, the remaining parts are equal) the task `GeneratePackageJsonProps` invoked from target `GeneratePackageJsonProps` silently fails.
Raising the build logging (i.e. to verbose) appears an error (the task is trying to add duplicated keys in a dictionary).
In this case the file `package.g.props` is not gegerated and then there are a lot of issues (i.e. `npm run build` is not executed...)

Example of "conflicting" dependecies (don't ask me why but yes, i need both in my project!!!):

```
"dependencies": {
"@babylonjs/inspector": "^7.19.0",
"babylonjs-inspector": "^7.19.0",
```

in this case both names `@babylonjs/inspector` and `babylonjs-inspector` are "mangled" by the task `GeneratePackageJsonProps` and becomes `babylonjsinspector` causing the issue...

i found a workaround using an npm alias:
```
"dependencies": {
"@babylonjs/inspector": "^7.19.0",
"standalone-babylonjs-inspector": "npm:babylonjs-inspector@^7.19.0",
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.