Skip to content

feat: Add url to lwc error#7051

Open
yashank676 wants to merge 2 commits intoforcedotcom:developfrom
yashank676:addUrlToLWCError
Open

feat: Add url to lwc error#7051
yashank676 wants to merge 2 commits intoforcedotcom:developfrom
yashank676:addUrlToLWCError

Conversation

@yashank676
Copy link
Copy Markdown

@yashank676 yashank676 commented Mar 24, 2026

What does this PR do?

  • Adds clickable URL links to LWC compiler and template diagnostic errors in the Problems panel
  • When an LWC error has an associated documentation URL (e.g. https://lwc.dev/guide/error_codes#lwcXXXX), it is now:
    • Appended to the diagnostic message text for visibility on hover
    • Set as a codeDescription.href so VS Code renders it as a clickable link on the error code
  • Upgrades @lwc/compiler, @lwc/errors, and @lwc/template-compiler from v8.x to v9.0.3 (ESM-only packages)
  • Adds CJS compatibility type declarations (typings/lwc.d.ts) for the ESM-only @lwc/* v9.x packages
  • Fixes Jest config to transform @lwc/* ESM packages via transformIgnorePatterns

What issues does this PR fix or reference?

Improves developer experience by surfacing LWC error documentation links directly in the editor diagnostics.

Functionality Before

LWC compiler/template errors displayed only the error message text with no link to documentation.
Screenshot 2026-03-24 at 8 42 20 PM

Functionality After

LWC errors that have a documentation URL now show:

Screenshot 2026-03-24 at 8 15 30 PM

@yashank676 yashank676 requested a review from a team as a code owner March 24, 2026 14:57
@salesforce-cla
Copy link
Copy Markdown

Thanks for the contribution! It looks like @yashank-aggarwal_sfemu is an internal user so signing the CLA is not required. However, we need to confirm this.

The @lwc/* v9.x packages ship as ESM-only, which causes Jest to fail
with "Cannot use import statement outside a module". Added
transformIgnorePatterns to allow ts-jest to transform @lwc packages.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant