You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have heard of users who have "type": "module" in their package.json, which often prevents the docusaurus.config.js file from being read correctly. We should support .cjs extension out-of-the-box, which can also enable us to support .mjs, or even .ts in the future.
In addition, I fixed a little bug with the error message where it's using the default config file name instead of the actual one.
I discovered that issue trying to migrate graphql-js to ESM and docusaurus is the only blocker left: graphql/graphql-js#3564 @Josh-Cena Big thanks for this PR 👍
@slorber@lex111 Can you please release a new beta with this change? 🙏
@IvanGoncharov This is more complex than that. See #7379 also, which kind of got blocked because of a cryptic error I don't know how to fix for now (and haven't looked deeply into).
If you just want the changes from this PR, you can always use docusaurus start --config docusaurus.config.cjs.
Also, we have our release schedule, so if we reviewed and merged it, you can always use the canary release instead of waiting for the next stable release.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pre-flight checklist
Motivation
Related: #6520, #5379
I have heard of users who have
"type": "module"in their package.json, which often prevents the docusaurus.config.js file from being read correctly. We should support .cjs extension out-of-the-box, which can also enable us to support .mjs, or even .ts in the future.In addition, I fixed a little bug with the error message where it's using the default config file name instead of the actual one.
Test Plan
Added a test case.
Test links
Deploy preview: https://deploy-preview-_____--docusaurus-2.netlify.app/
Related issues/PRs