quibble icon indicating copy to clipboard operation
quibble copied to clipboard

Fix: Resolve 3rd party esm without quibbledUrl

Open andreek opened this issue 1 year ago • 6 comments

In Node.js >= v21.0.0 quibble adds 3rd party libs with ?__quibble=0 suffix as key to the quibbled modules. When Node.js is resolving the real module quibble does not find the mock, because this url does not include ?__quibble=0.

I think it's related to these API changes: https://github.com/testdouble/quibble/pull/96

This PR fixes this problem by excluding urls with node_modules from being resolved with quibbledUrl.

Fixes: https://github.com/testdouble/testdouble.js/issues/530

andreek avatar Sep 11 '24 11:09 andreek

You may also want to consider other node resolution algorithms like PNPM and Yarn, both of which use symlinks that may result in not having a node_modules folder. For example, including .yarn or .pnpm.

quinnturner avatar Sep 27 '24 17:09 quinnturner

You may also want to consider other node resolution algorithms like PNPM and Yarn, both of which use symlinks that may result in not having a node_modules folder. For example, including .yarn or .pnpm.

Thanks for the hint but I don't see a problem if I'm not missing something. I've used PNPM to develop this PR and every symbolic link includes /node_modules/ as suffix. I'm not that familiar with yarn, but I don't run into a problem with it either.

andreek avatar Oct 16 '24 19:10 andreek

I can confirm that this PR makes quibble work with Node22. I'm using PNPM, so no troubles on that side. @searls any chance of getting this merged and released?

marcoreni avatar Oct 31 '24 17:10 marcoreni

HI @andreek, this issue is a blocker to migrate to new NodeJS version. Is this possible to merge the fix?

VadBary avatar Nov 11 '24 15:11 VadBary

I'm also looking forward to this fix 😔 @searls could you please help with reviewing and merging this?

OlyaFreedom avatar Nov 12 '24 09:11 OlyaFreedom

Up-voting for this. The issue in test-double/quibble+node >v20 is a moderate blocker for us 😔 Kindly ask @searls to assist with incorporating the fix

OTod avatar Nov 14 '24 11:11 OTod