Skip to content

Warnings for invalid pure annotations in node_modules are too noisy and look like errors #10183

Description

@crusty-voidzero

Reproduction

Building Codiff with vp build emits warnings like:

[INVALID_ANNOTATION] A comment "/*#__PURE__*/" in "node_modules/@lexical/react/dist/LexicalErrorBoundary.prod.mjs" contains an annotation that Rolldown cannot interpret due to the position of the comment.
 - comment ignored due to position in node_modules/@lexical/react/dist/LexicalErrorBoundary.prod.mjs at 581..594
  │
  │ Help: For more information on how to use pure annotations correctly, check the documentation: https://rolldown.rs/in-depth/dead-code-elimination#pure

I hit the same warning for multiple @lexical/react files under node_modules.

Problems

  1. INVALID_ANNOTATION is rendered in red even though this is only a warning, which makes the build look broken.
  2. The warning points at a transitive dependency in node_modules, so the app author usually can't do anything about it directly.
  3. Because the warning shows up on every build, it creates noise for humans and coding agents that keep re-flagging it as if it were a real failure.

Expected

A few possible improvements:

  • render this warning in a warning color instead of an error color
  • reduce or suppress this class of warning for node_modules / transitive dependencies
  • or otherwise make it clearer that Rolldown is safely ignoring the misplaced annotation and the build is still fine

Notes

The current behavior is technically correct, but the UX is pretty rough for downstream consumers when the source is third-party code.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

Priority

None yet

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions