Skip to content

Conversation

@JamieDanielson
Copy link
Member

Node.js has two module systems: CommonJS(CJS) and ECMAScript modules(ESM). As ESM becomes more common in usage, we need to better document the current assumptions and requirements.

This is a start with the bare minimum, which is to specify the assumption that the app is running as CJS... as well as document the loader hook currently required for ESM apps. It seemed useful to start here based on issues like #4812.

@JamieDanielson
Copy link
Member Author

I've incorporated the feedback from the original PR, and created new as I wasn't sure what would be easiest to review. Happy to reopen the old if that's better.

Copy link
Member

@vitorvasc vitorvasc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @JamieDanielson, thanks for this!

I left a small suggestion from a technical perspective so we can reuse these without needing to copy and paste.

@theletterf
Copy link
Member

/fix:refcache

@otelbot-docs
Copy link
Contributor

otelbot-docs bot commented Dec 18, 2025

fix:refcache applied successfully in run 20334630470.

Copy link
Contributor

@cartermp cartermp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall LGTM, but I recommend moving the second notice in the nodejs.md file down under Troubleshooting.


{{% /tab %}} {{< /tabpane >}}

{{% include esm-support-node.md %}}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure which one is intended, but the file is currently named sm-support-note.md, while the includes are referring to it as esm-support-node.md:

Suggested change
{{% include esm-support-node.md %}}
{{% include esm-support-note.md %}}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

4 participants