Cannot get Elements to work in Docusaurus #1777
-
Hello 👋🏽 I'm on the latest docusaurus version and I'm trying to use the Here's a link to a test repo: Error Log
I fixed most of the errors by adding ErrorsWhen running When running Error Log
I've used this config to get rid of all other errors except the two ones I've mentioned above: const config = {
plugins: [
// fixes process is not defined error
new webpack.DefinePlugin({
process: {
env: {},
},
}),
],
resolve: {
fallback: {
buffer: require.resolve('buffer'),
events: require.resolve('events'),
stream: require.resolve('stream-browserify'),
// doesn't work in browser when you visit /api
lodash: require.resolve('lodash'),
// build time errors
'@stoplight/http-spec/oas2': false,
'@stoplight/http-spec/oas3': false,
// cannot solve this
'abort-controller': require.resolve('abortcontroller-polyfill'), // also used `abort-controller`
},
},
}; |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 14 replies
-
Solved it! Used this webpack config: const config = {
module: {
rules: [
{
test: /\.m?js/,
resolve: {
fullySpecified: false,
},
},
],
},
plugins: [
new ProvidePlugin({
process: require.resolve('process/browser'),
}),
],
resolve: {
fallback: {
buffer: require.resolve('buffer'),
stream: false,
path: false,
process: false,
},
},
}; |
Beta Was this translation helpful? Give feedback.
Solved it!
Used this webpack config:
This helped: https://github.com/stoplightio/elements/pull/1640/files/db2a2a547aa4a3b567c02d254ff080c8cdddcfbd#diff-cafe2123a72c4ce3a9f7e9ee4b0e188256eb02d7ec1e54fa2cadfac99b22f92b