-
Notifications
You must be signed in to change notification settings - Fork 221
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
Stoplight element react failed with error #2483
Comments
|
Can someone please help to resolve the issue ? |
@dmuley17 we need more information to be able to help you:
|
Same issue here |
In https://github.com/stoplightio/json-schema-ref-parser/blob/master/lib/util/url.js#L31 , the code is requesting the NodeJS module url. Before webpack 5, this was polyfill by NodeJS but moving forward it needs to be added. Could you add it as a dependency? |
we are using react flavor of elements. Tried fixing all the as per web but still same issue persist and never got the success.For minimal reproducible we just need to follow - https://docs.stoplight.io/docs/elements/11b969f962273-elements-dev-portal-in-react npx create-react-app my-dir --template @stoplight/elements-dev-portal |
This ticket has been labeled jira. A tracking ticket in Stoplight's Jira ( |
@dmuley17 since CRA is now using webpack 5 that doesn't come with node polyfills anymore they need to be added separately. The easiest way to do that is to include node-polyfill-webpack-plugin to CRA webpack config. This can be done either by:
const NodePolyfillPlugin = require('node-polyfill-webpack-plugin');
...
plugins: [
// Other plugins...
new NodePolyfillPlugin(),
]
"scripts": {
"start": "react-app-rewired start",
"build": "react-app-rewired build",
"test": "react-app-rewired test",
"eject": "react-scripts eject"
}
const NodePolyfillPlugin = require("node-polyfill-webpack-plugin");
module.exports = function override(config, env) {
config.plugins.push(
new NodePolyfillPlugin()
);
return config;
}; We'll update elements docs with that process. |
I am trying to use
Elements Dev Portal
forREACT
after following the steps mentioned belowhttps://meta.stoplight.io/docs/elements/11b969f962273-elements-dev-portal-in-react
Application is failing to load and giving error
Attached error snippet from browser
Could you please guide and provide possible solution to fix the issue.
The text was updated successfully, but these errors were encountered: