docusaurus-theme-github-codeblock
docusaurus-theme-github-codeblock copied to clipboard
cannot resolve `url` with docusaurus 2.0.0-beta.18
Hey thanks for the repo, was looking to implement this but always nice when I don't have to.
Just tried using against latest 2.0.0-beta.18 of docusaurus v2.
Fails when loading a code block with the following.
Compiled with problems:
ERROR in ./node_modules/@saucelabs/theme-github-codeblock/build/theme/ReferenceCodeBlock/index.js 26:14-28
Module not found: Error: Can't resolve 'url' in '/Users/saf/dev/pactflow/docs.pactflow.io/website/node_modules/@saucelabs/theme-github-codeblock/build/theme/ReferenceCodeBlock'
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: { "url": require.resolve("url/") }'
- install 'url'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "url": false }
```
Removing the import from this line in the bundled output resolves it and it works fine
https://github.com/saucelabs/docusaurus-theme-github-codeblock/blob/3e94f0555f93f97fbb4db46673905dc6b9fe1635/src/theme/ReferenceCodeBlock/index.tsx#L1
Happy to submit a pull request
@discombobulateme Does this affect the docs site at all?
@boneskull no, we are not using the package :) thank you for asking it!
Hi, is this still WIP? I saw the PR, but no new one were made since then.
closing due to maintainer inactivity