-
Notifications
You must be signed in to change notification settings - Fork 6
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
oAuth Sign In possibly broken on front ends with Webpack 5 #153
Comments
PR UpdateAfter publishing json-api-client 5.0.4, I realise that I've updated the original post ☝️ with the following information: Solution cannot be applied at either PJC or json-api-client, AFAICT. (This is because the problem stems from Webpack 5, and neither use Webpack 5.) Solution must therefore be performed at the front end project which uses Webpack 5.
|
This is actually a bug in
|
We can fix this, here:
The native URL interface is supported in Node since Node 10, so remove This note is actually in the Readme for
|
Functionality Issue
If a Custom Front End (e.g. Classrooms) upgrades from Webpack 4 to Webpack 5, there's a chance that Sign In via oAuth is broken.
Symptoms:
zooniverse.org/api/me
to find out who's signed in.This can be a result of Webpack 5 removing default polyfills for the Node.js
url
library, which causes a hidden chain of failures when signing in.Probable triggers:
resolve.fallback = { url: false }
, which is usually added to solve build issues onwebpack-dev-server
4 onwards.Dev Notes
Full failure chain:
panoptes-client
usesjson-api-client
usesnormalizeurl
0.1.3normalizeurl
0.1.3 expects the Node.jsurl
module. If that doesn't exist, it falls back to its own parsing code.normalizeurl
's fallback parsing code is limited and throws a 'Cannot normalize absolute and protocol-relative urls passed as a string without the node.js url module' error whenever you try to getzooniverse.org/api/me
panoptes-client
hides that error, so it just looks like you can't login for some mysterious reasonnormalizeurl 1.0.0 fixes the fallback parsing code that was borked in 0.1.3.Status
Solution in progress.Solution cannot be applied at either PJC or json-api-client, AFAICT.Workaround (if you need things fixed right now): 1. addresolve.fallback = { url: require.resolve("url") }
and 2. addurl
to package.json's dependenciesLong term (by end of week): I'm in the process of upgradingpanoptes-client
andjson-api-client
, so a few version bumps should fix the problem for all projects.Solution must be performed at the front end project which uses Webpack 5
resolve.fallback = { url: require.resolve("url") }
to the Webpack config.url
to package.json's dependenciesThe text was updated successfully, but these errors were encountered: