-
Notifications
You must be signed in to change notification settings - Fork 7.8k
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
ERROR: Cannot read property 'split' of undefined #735
Comments
Thanks a lot for reporting this issue. Can you please post the whole error message. It should probably also display the stack trace in the node. Thanks! |
Hello @janober, Thanks for your fast answer and the great platform that is n8n. Here is the stack trace on the node:
Please let me know if I can help any further |
Hello, I have investigated the code a bit and I see that the
is undefined while
is defined.
Goes in the else part causing the issue. I modified the code in this way:
and it seems to work but I am not sure I am causing other issues down the line with this assumption. I thought this might help to know though. Thanks again... |
@Laazarus yes, this has happened to my a couple of times, this happens cuz according to the standard when getting the accessToken the endpoint should return the token type as well, and it should be bearer, some of the companies do not do this, and the library it's expecting that tokenType = 'bearer'. That is why it failed. Maybe with a condition, after the token exchange, like if the response does not include token type, then we add it manually. Your approach works but you had to modify the npm package. |
Hello @RicardoE105 , Thanks for your answer, yes that was my intention with that fix. Basically if we are dealing with APIs that do not respect the standards (AKA LinkedIn) We set as default the type as Bearer. |
Can you please check with the latest version if that issue is fixed now? Thanks! |
Closing this issue now. If you are still having this problem simply comment here. |
I'm having the same problem, I call an api but if I print the result on the first line I already get this message (node: 18288) UnhandledPromiseRejectionWarning: Error: TypeError: Cannot read property |
Describe the bug
I created Oauth2 credentials for LinkedIn and I tested the connection giving the authorisation, Everything worked showing that the connection was successful. When I use the credentials in a HTTP Request node I get the exception ERROR: Cannot read property 'split' of undefined
To Reproduce
Steps to reproduce the behavior:
Expected behavior
I would expect that the authentication with LinkedIn using the credentials created would succeed
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: