Skip to content
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

Login from nodejs is broken (and most of a fix?) #25

Closed
jeff-zucker opened this issue May 8, 2021 · 2 comments
Closed

Login from nodejs is broken (and most of a fix?) #25

jeff-zucker opened this issue May 8, 2021 · 2 comments

Comments

@jeff-zucker
Copy link
Member

Login from nodejs now produces

(node:816301) UnhandledPromiseRejectionWarning: TypeError: form_urlencoded_1.default is not a function
    at TokenRequester.request (/home/jeff/Dropbox/Web/solid/solid-node-client/node_modules/solid-auth-fetcher/dist/login/oidc/TokenRequester.js:53:44)

This error does not occur when using form-urlencoded@4.1.4 but does occur with the latest version 4.5.1. It has something to do with how the function is exported. This change to solid-auth-fetcher's dist/* makes solid-auth-fetcher work with either version, but I can not figure out how to change it in the src/* typescript.

// Remove ths line (20) in dist/login/oidc/TokenRequester.js
Line 20 const form_urlencoded_1 = __importDefault(require("form-urlencoded"));
// Replace with these : 
let form_urlencoded_1 = __importDefault(require("form-urlencoded"));
if( typeof form_urlencoded_1.default != "function" ) {
  form_urlencoded_1 = form_urlencoded_1.default ;
} 
@jeff-zucker
Copy link
Member Author

Note : on my system, installing from a git\hub fork works but installing from the npm does not - it pulls in the newer form-urlencoded.

@jeff-zucker
Copy link
Member Author

On the up side - people are using this nodejs login via solid-node-client to run express apps on android. :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant