ChainSafe / ChainSafe/lodestar
Experiment with light-client in docusaurus
- Dominant language
- TypeScript
- Stars
- 1.4k
- Forks
- 483
- Avg merge
- 1d 16h
- Merged PRs (30d)
- 150
Description
Using `light-client` with docusaurus triggers a number of errors. While it might be doable to tweak `webpack` configuration to overcome those, it looks worth looking at tackling those individually to improve end-user experience.
# What can be done
* bls (crypto in `blst-native`); should not be used, might require [conditional exports](https://nodejs.org/api/packages.html#conditional-exports)
* blst (crypto, `ls`, `path` in script); same as previous
* bls-eth-wasm (`crypto`); fixed by https://github.com/ChainSafe/bls/pull/159
* eventsource (http, https) https://github.com/ChainSafe/lodestar/issues/6542
# Errors
```js
Module not found: Error: Can't resolve 'crypto' in '/Users/julien/Documents/Projects/jeluard/lodestar/docs/node_modules/bls-eth-wasm/src'
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.
If you want to include a polyfill, you need to:
- add a fallback 'resolve.fallback: { "crypto": require.resolve("crypto-browserify") }'
- install 'crypto-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "crypto": false }
--------------------------
Module not found: Error: Can't resolve 'https' in '/Users/julien/Documents/Projects/jeluard/lodestar/docs/node_modules/eventsource/lib'
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.
If you want to include a polyfill, you need to:
- add a fallback 'resolve.fallback: { "https": require.resolve("https-browserify") }'
- install 'https-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "https": false }
--------------------------
Module not found: Error: Can't resolve 'http' in '/Users/julien/Documents/Projects/jeluard/lodestar/docs/node_modules/eventsource/lib'
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.
If you want to include a polyfill, you need to:
- add a fallback 'resolve.fallback: { "http": require.resolve("stream-http") }'
- install 'stream-http'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "http": false }
--------------------------
Module not found: Error: Can't resolve 'crypto' in '/Users/julien/Documents/Projects/jeluard/lodestar/node_modules/@chainsafe/blst/dist'
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.
If you want to include a polyfill, you need to:
- add a fallback 'resolve.fallback: { "crypto": require.resolve("crypto-browserify") }'
- install 'crypto-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "crypto": false }
--------------------------
Module not found: Error: Can't resolve 'fs' in '/Users/julien/Documents/Projects/jeluard/lodestar/node_modules/@chainsafe/blst/dist/scripts'
--------------------------
Module not found: Error: Can't resolve 'path' in '/Users/julien/Documents/Projects/jeluard/lodestar/node_modules/@chainsafe/blst/dist/scripts'
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.
If you want to include a polyfill, you need to:
- add a fallback 'resolve.fallback: { "path": require.resolve("path-browserify") }'
- install 'path-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "path": false }
--------------------------
Module not found: Error: Can't resolve 'crypto' in '/Users/julien/Documents/Projects/jeluard/lodestar/docs/node_modules/@chainsafe/bls/lib/blst-native'
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.
If you want to include a polyfill, you need to:
- add a fallback 'resolve.fallback: { "crypto": require.resolve("crypto-browserify") }'
- install 'crypto-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "crypto": false }
```
Contributor guide
Assessment
This issue has not been assessed yet.