-
Notifications
You must be signed in to change notification settings - Fork 209
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
4.1 introduced breaking changes #246
Comments
Also breaking our jest tests. Don't see any breaking changes mentioned in the release notes. |
Same here! Happy that this isn't a bug on our end, was about to throw the computer out the window. More info: |
@awaterma after reviewing a few things, this is definitely a breaking change and probably causing lots of headaches right now. Recommend publishing a rollback minor release and pushing v5 with any updates. For now, we are manually overriding the dep via PNPM as we can't update JSDom ourselves and there provide no easy way of patching this (e.g. to provide the options recommended in the error)... \ |
I'm sorry this is causing you all some issues! For some background on how to use localhost as a special use domain, please see the discussion and tests in issue #215. I believe this is coming up for v4.1.0 as @ShivanKaul implemented all of the "special-use" domains per RFC 6761 in the following p/r: https://github.com/salesforce/tough-cookie/pull/203/files, which we included in this release. We view this as continued work for the RFC that we started in v4.0.0. In regards to working with cookies in I will reach out to the team in Slack and see if we can get some discussion going. Sorry to cause issues for those that depend upon us; we are working to improve |
Most of us can certainly empathize with these type of challenges so no worries there. We appreciate the work on keeping things compliant. Al final, i think the best course of action is to move this to version 5; as a practice versions in NPM should live and die with Semver since things are automatically updated and hard to override (using standard NPM client)... By that, I mean RFC targets shouldn't have any relation to version numbers being used. |
If you are using [email protected] add testEnvironmentOptions: {
url: 'https://jestjs.io'
} to jest config file testURL: 'https://jestjs.io' to jest config file You can change |
Broke my environment as well. Is there a simple fix for it, other than to pinpoint to the last version? |
Faced this problem this morning, jest test failing, quick walkaround is to add |
You can also add as a workaround in your pacakge.json : |
@lyz810 Adding a valid fully qualified domain name for |
tough-cookie 4.1 broke testing with MSW salesforce/tough-cookie#246 (comment)
New version introduced following error |
Another workaround is setting your own CookieJar for the jsdom environment:
You have to use a FQDN even for localhost otherwise you will run into #248 bug. |
@CSchulz when I've tried that, I get an error that |
I have raised a PR to fix the version of tough-cookie to v4.0.0 which should fix the immediate problem |
Do you have a more detailled stacktrace? |
Does anyone have a working override config for pnpm? I've tried: {
"pnpm": {
"overrides": {
"tough-cookie": "4.0.0"
}
}
} It does not seem to work, as EDIT: It seems that this works after installing |
Ohhh THIS is why all our tests are breaking. 🤦♂️ |
Related #248 |
failing for me on npm v6. tried both in package.json |
This solution totally depends on which package-manager you are using, for npm v8+, add overrides key |
I am also still seeing this issue using 4.1.1: |-- [email protected] Did the patch completely revert the change that caused this, or was there a new patch laid over the original change in an attempt to fix? |
4.1.1 doesn't solve the issue for Vitest users because (at least to my knowledge, please correct me if I'm wrong) there's no way to configure jsdom -- our tests are still failing. (The workaround is to override tough-cookie version to 4.0.0)
|
4.1.1 - this does not solve the issue. |
4.1.1 not working for me either |
4.1.1 still not working |
avoiding breaking changes mentioned here salesforce/tough-cookie#246 which no longer allows localhost domains
having the same issue with 4.1.1 |
* fix: allow set cookies with localhost Adding more tests to cover the breaking use cases noted in #246. e.g.;. * `new CookieJar().setCookieSync("settingThisShouldPass=true; Domain=localhost; Path=/;", "http://localhost")` Also modifies the assertion for a test introduced in #221 that may be incorrect. * fix: allow set cookies with localhost Adding more tests to cover the breaking use cases noted in #246. e.g.;. * `new CookieJar().setCookieSync("settingThisShouldPass=true; Domain=localhost; Path=/;", "http://localhost")` Also modifies the assertion for a test introduced in #221 that may be incorrect. * fix: allow set cookies with localhost Adding more tests to cover the breaking use cases noted in #246. e.g.;. * `new CookieJar().setCookieSync("settingThisShouldPass=true; Domain=localhost; Path=/;", "http://localhost")` Also modifies the assertion for a test introduced in #221 that may be incorrect. * fix: allow set cookies with localhost updated CHANGELOG.md to point to the releases page since changelogs are auto-generated now. * Release v4.1.2
We have a new patch for this issue. We believe that we have now resolved a bug for how we treated single word special use domains (localhost and invalid) that should resolve this issue for everyone. |
@awaterma - I can confirm that 4.1.2 is working for us. Really appreciate the ownership on the issue and swiftness with which the patch was released. Thanks a lot. |
Also confirm 4.1.2 is working here. For users who had trouble with jsdom/jest, you can add {
"overrides": {
"tough-cookie": "4.1.2"
}
} Reference: https://stackoverflow.com/a/64273186 |
`tough-cookie` which is a dependency of JSDOM did a breaking change in version 4.1 which requires special handling for cookies in localhost. See: salesforce/tough-cookie#246
`tough-cookie` which is a dependency of JSDOM did a breaking change in version 4.1 which requires special handling for cookies in localhost. See: salesforce/tough-cookie#246
`tough-cookie` which is a dependency of JSDOM did a breaking change in version 4.1 which requires special handling for cookies in localhost. See: salesforce/tough-cookie#246 (cherry picked from commit 6dcce85)
Also here to confirm the new version works for us :) |
Our jest environment just started throwing errors because
allowSpecialUseDomain
is now being more enforced in this new release andjest-environment-jsdom
doesn't set it. I tried to correct for it via Jest'stestEnvironmentOptions
config passthru, but that produced other problems. You may want to revert that release, it's gonna break a WHOLE LOT of builds.The text was updated successfully, but these errors were encountered: