-
Notifications
You must be signed in to change notification settings - Fork 225
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
v2.5.0 : str.trim() is not a function #132
Comments
We're seeing the same issue |
Same here with the same setup. My cookie that looks like a This is probably because my outside Edit: I tried downgrading but it's still not working. Maybe it's because I'm using workspaces and the two instances are loaded from different directories. |
Used Node 8, but I worked around the bug by converting the cookie into a cookie string and passing that to the library instead of an object. |
Thanks @gombosg.
FWIW, I'm able to reproduce this in a test now with request 2.88.0 and node 11.4.0. I'll look into it again later today. |
Thanks for looking into this @stash! |
Noticed the same error when:
In our case it ended up Although, given the initial example this may not be related. |
Addresses #132, partially. The error message is clearer, indicating that this method only accepts the afformentioned types. The part of 132 that it doesn't address is the whole "Cookie instance from another version of the `tough-cookie` package" thing, which isn't really solvable unless we somehow expose the Cookie class that "belongs to" this CookieJar class, which is maybe another patch.
I'm still seeing this with v3.0.1. $ npm ls --depth=0
+-- @types/commander@2.12.2
+-- @types/inquirer@6.0.3
+-- @types/node@12.0.10
+-- @types/request-promise-native@1.0.16
+-- @types/tough-cookie@2.3.5
+-- commander@2.20.0
+-- idx@2.5.6
+-- inquirer@6.4.1
+-- request@2.88.0
+-- request-promise-native@1.0.7
+-- tough-cookie@3.0.1
`-- typescript@3.5.2 |
typescript workaround jar.setCookie(JSON.stringify(cookie), '.teamaster.club') |
I'll take a look once I have a little time, probably over the weekend. We haven't had a release for a bit. We are working on closing out p/r to prepare for an update. Apologies for our tardiness. Pull request would also be appreciated to resolve the issue. |
It's been almost a year :( |
This is a volunteer effort, with our focus on maintaining the codeline. Pull Requests are always appreciated, and are what we focus on first. Please take a look at our contributor's agreement. |
I've assigned this to myself; I'll try and pick up when I can. Sorry for our delays. |
@awaterma I just hit the exact same
|
Ill take a look! Thank you for the report!
…On Fri, Jan 17, 2020 at 7:59 AM Gabriel Lomba ***@***.***> wrote:
@awaterma <https://github.com/awaterma> I just hit the exact same instanceof
Cookie issue but in a different spot in the code.
Cookiejar.serialize tries to delete creationIndex prop after getting all
cookies from the store here
<https://github.com/salesforce/tough-cookie/blob/dcfdd032332ece5e60b732f3371f5e08d9e20cef/lib/cookie.js#L1443>
but the condition fails, causing it to try to delete the prop in the
original Cookie object, raising a TypeError: Cannot delete property
'creationIndex' of [object Object].
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#132?email_source=notifications&email_token=AAAP6G2H6AXEKPD7CVGW3WLQ6G2RLA5CNFSM4GHFWUV2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJHYG7Y#issuecomment-575636351>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAP6G72ZHXTVL4C43K6LADQ6G2RLANCNFSM4GHFWUVQ>
.
|
Tried upgrading to 4.0.0 and it still has this error. |
Sorry to be slow on this; I'll put this issue onto our project board and will try and take a look as soon as we can. |
The same issue here. |
Stash was able to reproduce this some time back with Request and Node 8; I'll see if I can add a unit test that reproduces this for us, so we can make some progress. |
Tried upgrading to 4.0.0 and it still has this error,too. |
@PCAaron can you paste in the latest error you are getting? |
I think we have a fix for this now; please take a look: #209 |
This should be closed in p/r #209. If you can pull down the latest in Git (we haven't released these fixes to NPM yet), this issue should be resolved. If you are still seeing a similar issue, please open a new issue, hopefully with a reproducible test case, so we can take a look. Thank you! |
We're using tough-cookie ^2.4.3 (which actually installs 2.5.0) with request ^2.88.0.
This code worked with 2.4.3 :
But we're getting the following error with 2.5.0 :
Any hint about what could cause this issue in 2.5.0?
Thanks!
The text was updated successfully, but these errors were encountered: