syncpack icon indicating copy to clipboard operation
syncpack copied to clipboard

Setting workspace depencyType throws uncaught runtime error

Open Coobaha opened this issue 3 years ago • 4 comments
trafficstars

Description

hi @JamieMason after https://github.com/JamieMason/syncpack/commit/2d1bf059a239dff3af203104491a315b894b8796#diff-c58dda308b363b6022c8a03f2d4ae8fd387425eb7a733f166bfd7d93d68ef11fL12

I am getting uncaught TypeError in a yarn workspace codebase

dependencies @org/package ^0.1.1
workspace @org/package ^0.1.1
~/node_modules/syncpack/dist/bin-set-semver-ranges/set-semver-ranges.js:18
                root[dependencyType][name] = nextVersion;
                                           ^

Coobaha avatar Jun 26 '22 10:06 Coobaha

Can you edit your local install at node_modules/syncpack/dist/bin-set-semver-ranges/set-semver-ranges.js to include this log, run syncpack again, then share the output?

+ console.log(
+   require('util').inspect(
+     { input, dependencyType, name, version, wrapper },
+     false,
+     null,
+     true,
+   ),
+ );
root[dependencyType][name] = nextVersion;

JamieMason avatar Jun 26 '22 14:06 JamieMason

Sorry I can't just dump outputs at the moment, cause it contains private codebase data. I will try to make a reproducible example later this week. Meanwhile maybe it might help, we enforce explicit dependencies for packages, so they also have workspace packages listed in package.json (I assume thats why same package is logged twice in my initial message)

Coobaha avatar Jun 27 '22 08:06 Coobaha

That's understandable, no worries. If you can make a repro that would be great, at the moment I don't have enough to work with to know what it could be.

JamieMason avatar Jun 27 '22 09:06 JamieMason

Hey, here is the repro https://stackblitz.com/edit/github-nztxhj-ks9wvj?file=package.json

image

Coobaha avatar Jun 27 '22 12:06 Coobaha

Released in 8.3.8, thanks a lot.

JamieMason avatar Oct 28 '22 16:10 JamieMason