Closed strmer15 closed 8 months ago
Im not actually able to reproduce this. Is this setup available on a public repo?
Im not actually able to reproduce this. Is this setup available on a public repo?
Hmmm... ok, thanks for looking into it. It's not available publicly but I'll see if I can create a simple reproduction or figure out why this is happening. It seems like it must be due to some typedoc
import that we have in our code somewhere that the Docusaurus webpack
config is picking up.
I dug into this some more and found that I was importing ReflectionKind
from typedoc
into some of the docusaurus components that were being used. Once I removed those imports the errors went away and thing worked correctly again, without the extra webpack config. Sorry for the false alarm!
When using
docusaurus-plugin-typedoc
0.21.0 with Docusaurus v3, thestart
andbuild
scripts throw a number of errors.Initially, I got errors like
Module not found: Error: Can't resolve 'path'
,Module not found: Error: Can't resolve 'module'
, etc. Here's an example:I updated the webpack config in the plugin to use
resolve.fallback
and theNodePolyfillPlugin
(https://github.com/Richienb/node-polyfill-webpack-plugin), but then got errors aboutprocess
not being defined, so I added in theDefinePlugin
for that. The last problem was that during the server build, I would get errors about__dirname
not being defined either, so I added another entry in theDefinePlugin
to set it to an empty string.I also got some warnings about dynamic require / import statements that webpack couldn't get context on, so I added in some
ContextReplacementPlugin
instances to turn off those warnings. The warning wasI created my own plugin that fixed all of the various errors:
I don't know if there's a better way to solve this, but that's what I came up with. It would be great if this plugin could fix these errors without needing to customize the webpack config.
Thanks for creating and maintaining this software! Please let me know if there's additional information that you need about this and I'd be happy to help.