pgsandstrom / package-json-upgrade

MIT License
49 stars 10 forks source link

dependencies with "-next." in them break the extension #11

Closed timfee closed 4 years ago

timfee commented 4 years ago

The extension was able to update when my package.json was:

 "dependencies": {
    "next": "9.5.3",
    "react": "^16.13.1",
    "react-dom": "^16.13.1"
  },
  "devDependencies": {
    "@babel/core": "^7.11.6",
    "@types/node": "^14.10.1",
    "@types/react": "^16.9.49",
    "@types/react-dom": "^16.9.8",
    "typescript": "^4.0.2",
    "tailwindcss": "^1.8.9",
    "babel-plugin-macros": "^2.8.0",
    "@tailwindcss/ui": "^0.6.0",
    "@tailwindcssinjs/macro": "^0.9.2"
  },

but began failing when I added a few new -next version:

 "dependencies": {
    "next": "9.5.3",
    "react": "^16.13.1",
    "react-dom": "^16.13.1"
  },
  "devDependencies": {
    "@emotion/babel-plugin": "^11.0.0-next.12",
    "@emotion/server": "^11.0.0-next.12",
    "@babel/core": "^7.11.6",
    "@types/node": "^14.10.1",
    "@types/react": "^16.9.49",
    "@types/react-dom": "^16.9.8",
    "typescript": "^4.0.2",
    "tailwindcss": "^1.8.9",
    "babel-plugin-macros": "^2.8.0",
    "@tailwindcss/ui": "^0.6.0",
    "@tailwindcssinjs/macro": "^0.9.2"
  },

The message is:

Command 'Update all dependencies in the current package.json file' resulted in an error (Running the contributed command: 'package-json-upgrade.update-all' failed.)

Some log info:

[2020-09-13 09:27:26.740] [exthost] [warning] codeandstuff.package-json-upgrade - Code actions of kind 'quickfix 'requested but returned code action is of kind ''. Code action will be dropped. Please check 'CodeActionContext.only' to only return requested code actions.
[2020-09-13 09:29:27.705] [exthost] [error] TypeError: Reduce of empty array with no initial value
    at Array.reduce (<anonymous>)
    at Object.t.getLatestVersion (/Users/timfee/.vscode/extensions/codeandstuff.package-json-upgrade-1.2.0/out/extension.js:1:44126)
    at /Users/timfee/.vscode/extensions/codeandstuff.package-json-upgrade-1.2.0/out/extension.js:39:54548
    at Array.map (<anonymous>)
    at Object.t.updateAll (/Users/timfee/.vscode/extensions/codeandstuff.package-json-upgrade-1.2.0/out/extension.js:39:54223)
    at /Users/timfee/.vscode/extensions/codeandstuff.package-json-upgrade-1.2.0/out/extension.js:1:115846
    at _executeContributedCommand (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:675:513)
    at _.$executeContributedCommand (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:675:888)
    at g._doInvokeHandler (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:860:464)
    at g._invokeHandler (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:860:156)
    at g._receiveRequest (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:858:817)
    at g._receiveOneMessage (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:857:623)
    at /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:855:691
    at l.fire (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:46:475)
    at v.fire (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:256:381)
    at /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:1047:649
    at l.fire (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:46:475)
    at v.fire (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:256:381)
    at t.PersistentProtocol._receiveMessage (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:261:451)
    at /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:258:489
    at l.fire (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:46:475)
    at p.acceptChunk (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:253:851)
    at /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:253:203
    at Socket.t (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:263:54)
    at Socket.emit (events.js:223:5)
    at Socket.EventEmitter.emit (domain.js:475:20)
    at addChunk (_stream_readable.js:309:12)
    at readableAddChunk (_stream_readable.js:290:11)
    at Socket.Readable.push (_stream_readable.js:224:10)
    at Pipe.onStreamRead (internal/stream_base_commons.js:181:23) package-json-upgrade.update-all
[2020-09-13 09:29:43.639] [exthost] [error] TypeError: Reduce of empty array with no initial value
    at Array.reduce (<anonymous>)
    at Object.t.getLatestVersion (/Users/timfee/.vscode/extensions/codeandstuff.package-json-upgrade-1.2.0/out/extension.js:1:44126)
    at /Users/timfee/.vscode/extensions/codeandstuff.package-json-upgrade-1.2.0/out/extension.js:39:54548
    at Array.map (<anonymous>)
    at Object.t.updateAll (/Users/timfee/.vscode/extensions/codeandstuff.package-json-upgrade-1.2.0/out/extension.js:39:54223)
    at /Users/timfee/.vscode/extensions/codeandstuff.package-json-upgrade-1.2.0/out/extension.js:1:115846
    at _executeContributedCommand (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:675:513)
    at _.$executeContributedCommand (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:675:888)
    at g._doInvokeHandler (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:860:464)
    at g._invokeHandler (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:860:156)
    at g._receiveRequest (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:858:817)
    at g._receiveOneMessage (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:857:623)
    at /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:855:691
    at l.fire (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:46:475)
    at v.fire (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:256:381)
    at /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:1047:649
    at l.fire (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:46:475)
    at v.fire (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:256:381)
    at t.PersistentProtocol._receiveMessage (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:261:451)
    at /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:258:489
    at l.fire (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:46:475)
    at p.acceptChunk (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:253:851)
    at /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:253:203
    at Socket.t (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:263:54)
    at Socket.emit (events.js:223:5)
    at Socket.EventEmitter.emit (domain.js:475:20)
    at addChunk (_stream_readable.js:309:12)
    at readableAddChunk (_stream_readable.js:290:11)
    at Socket.Readable.push (_stream_readable.js:224:10)
    at Pipe.onStreamRead (internal/stream_base_commons.js:181:23) package-json-upgrade.update-all
[2020-09-13 09:31:33.715] [exthost] [error] TypeError: Reduce of empty array with no initial value
    at Array.reduce (<anonymous>)
    at Object.t.getLatestVersion (/Users/timfee/.vscode/extensions/codeandstuff.package-json-upgrade-1.2.0/out/extension.js:1:44126)
    at /Users/timfee/.vscode/extensions/codeandstuff.package-json-upgrade-1.2.0/out/extension.js:39:54548
    at Array.map (<anonymous>)
    at Object.t.updateAll (/Users/timfee/.vscode/extensions/codeandstuff.package-json-upgrade-1.2.0/out/extension.js:39:54223)
    at /Users/timfee/.vscode/extensions/codeandstuff.package-json-upgrade-1.2.0/out/extension.js:1:115846
    at _executeContributedCommand (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:675:513)
    at _.$executeContributedCommand (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:675:888)
    at g._doInvokeHandler (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:860:464)
    at g._invokeHandler (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:860:156)
    at g._receiveRequest (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:858:817)
    at g._receiveOneMessage (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:857:623)
    at /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:855:691
    at l.fire (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:46:475)
    at v.fire (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:256:381)
    at /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:1047:649
    at l.fire (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:46:475)
    at v.fire (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:256:381)
    at t.PersistentProtocol._receiveMessage (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:261:451)
    at /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:258:489
    at l.fire (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:46:475)
    at p.acceptChunk (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:253:851)
    at /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:253:203
    at Socket.t (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:263:54)
    at Socket.emit (events.js:223:5)
    at Socket.EventEmitter.emit (domain.js:475:20)
    at addChunk (_stream_readable.js:309:12)
    at readableAddChunk (_stream_readable.js:290:11)
    at Socket.Readable.push (_stream_readable.js:224:10)
    at Pipe.onStreamRead (internal/stream_base_commons.js:181:23) package-json-upgrade.update-all
[2020-09-13 09:33:26.003] [exthost] [error] TypeError: Reduce of empty array with no initial value
    at Array.reduce (<anonymous>)
    at Object.t.getLatestVersion (/Users/timfee/.vscode/extensions/codeandstuff.package-json-upgrade-1.2.0/out/extension.js:1:44126)
    at /Users/timfee/.vscode/extensions/codeandstuff.package-json-upgrade-1.2.0/out/extension.js:39:54548
    at Array.map (<anonymous>)
    at Object.t.updateAll (/Users/timfee/.vscode/extensions/codeandstuff.package-json-upgrade-1.2.0/out/extension.js:39:54223)
    at /Users/timfee/.vscode/extensions/codeandstuff.package-json-upgrade-1.2.0/out/extension.js:1:115846
    at _executeContributedCommand (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:675:513)
    at _.$executeContributedCommand (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:675:888)
    at g._doInvokeHandler (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:860:464)
    at g._invokeHandler (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:860:156)
    at g._receiveRequest (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:858:817)
    at g._receiveOneMessage (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:857:623)
    at /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:855:691
    at l.fire (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:46:475)
    at v.fire (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:256:381)
    at /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:1047:649
    at l.fire (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:46:475)
    at v.fire (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:256:381)
    at t.PersistentProtocol._receiveMessage (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:261:451)
    at /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:258:489
    at l.fire (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:46:475)
    at p.acceptChunk (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:253:851)
    at /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:253:203
    at Socket.t (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:263:54)
    at Socket.emit (events.js:223:5)
    at Socket.EventEmitter.emit (domain.js:475:20)
    at addChunk (_stream_readable.js:309:12)
    at readableAddChunk (_stream_readable.js:290:11)
    at Socket.Readable.push (_stream_readable.js:224:10)
    at Pipe.onStreamRead (internal/stream_base_commons.js:181:23) package-json-upgrade.update-all
pgsandstrom commented 4 years ago

Thank you for the excellent bug report! I can replicate the error and will try to get an update out as soon as possible.

pgsandstrom commented 4 years ago

I have release version 1.2.1 that should resolve this issue. I will close this issue in the meantime, but please let me know if you have any problems with the new version.