Skip to content
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

docusaurus ESM support #329

Closed
WodenWang820118 opened this issue Oct 14, 2024 · 1 comment
Closed

docusaurus ESM support #329

WodenWang820118 opened this issue Oct 14, 2024 · 1 comment

Comments

@WodenWang820118
Copy link

Hi, team
I encountered an issue when having a Vite-related project within my Nx workspace. The error is related to the deprecation of compiling CJS build for Node API in Vite. While removing "type": "module" from package.json resolves the issue and I can build the docusaurus documentation site, I prefer to keep it to avoid conflicts for different builds in the future.

The client-module.js file throws an error stating that require is not defined if I keep the "type:" "module" in the package.json.
The error Message:

require is not defined
    at eval (client-modules.js:1:1)
    at ./apps/ng-frontend-doc/.docusaurus/client-modules.js (main.js:1812:1)
    at __webpack_require__ (runtime~main.js:34:32)
    at fn (runtime~main.js:334:21)
    at eval (App.js:7:83)
    at ./node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected]_@[email protected]__esbuild@0_2x46kw3hanuzfbi7ssabq4koka/node_modules/@docusaurus/core/lib/client/App.js (main.js:23:1)
    at __webpack_require__ (runtime~main.js:34:32)
    at fn (runtime~main.js:334:21)
    at eval (clientEntry.js:9:62)
    at ./node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected]_@[email protected]__esbuild@0_2x46kw3hanuzfbi7ssabq4koka/node_modules/@docusaurus/core/lib/client/clientEntry.js (

How can I amend it or any workarounds available? Thanks.

Best Regards,
Guan Xin Wang

@TriPSs
Copy link
Owner

TriPSs commented Oct 14, 2024

Looking at the error it looks to be a Docusaurus issue, maybe check there? The do seem to have a issue for ESM support (facebook/docusaurus#6520)

@TriPSs TriPSs closed this as not planned Won't fix, can't repro, duplicate, stale Oct 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants