Skip to content

fix(apollo-wind): fix prism import issues on vitest for consumers#295

Open
CalinaCristian wants to merge 1 commit intomainfrom
fix/attempt
Open

fix(apollo-wind): fix prism import issues on vitest for consumers#295
CalinaCristian wants to merge 1 commit intomainfrom
fix/attempt

Conversation

@CalinaCristian
Copy link
Collaborator

@CalinaCristian CalinaCristian commented Mar 4, 2026

Consumers running vitest/Jest fail when importing @uipath/apollo-wind because the code-block component uses a directory import (react-syntax-highlighter/dist/esm/styles/prism) that Node's ESM resolver cannot resolve.

Root cause

react-syntax-highlighter has no exports map in its package.json — only main/module. Subpath imports resolve via the filesystem directly. Since apollo-wind is built with bundle: false, the import passes through as-is into dist/. When a consumer's test runner uses Node ESM resolution on dependencies in node_modules, it rejects directory imports (Node ESM requires explicit file paths, unlike CJS which auto-resolves index.js).

Fix

  • Point the import at the explicit index.js barrel file (react-syntax-highlighter/dist/esm/styles/prism/index.js)
  • Add a minimal .d.ts declaration since @types/react-syntax-highlighter only types the directory path

@CalinaCristian CalinaCristian added the dev-packages Adds dev package publishing on pushes to this PR label Mar 4, 2026
Copilot AI review requested due to automatic review settings March 4, 2026 18:33
@github-actions
Copy link

github-actions bot commented Mar 4, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (PT)
apollo-canvas 🟢 Ready Preview, Logs Mar 04, 2026, 12:13:00 PM
apollo-ui-react 🟢 Ready Preview, Logs Mar 04, 2026, 12:11:35 PM
apollo-vertex 🟢 Ready Preview, Logs Mar 04, 2026, 12:10:52 PM
apollo-wind 🟢 Ready Preview, Logs Mar 04, 2026, 12:10:49 PM

@github-actions
Copy link

github-actions bot commented Mar 4, 2026

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@github-actions
Copy link

github-actions bot commented Mar 4, 2026

📦 Dev Packages

🧹 Dev packages cleaned up after PR close.

Last updated: 2026-03-04 11:32:10 PT

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the CodeBlock component in @uipath/apollo-wind to change how Prism theme styles are imported from react-syntax-highlighter, aiming to resolve Prism style import issues.

Changes:

  • Replaced named-imports from react-syntax-highlighter/dist/esm/styles/prism with per-style direct imports.
  • Minor formatting change in getBodyTheme() for readability.

You can also share your feedback on Copilot code review. Take the survey.

@CalinaCristian CalinaCristian force-pushed the fix/attempt branch 2 times, most recently from 34c7bf7 to f3b88be Compare March 4, 2026 18:53
Copilot AI review requested due to automatic review settings March 4, 2026 18:53
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 2 changed files in this pull request and generated 1 comment.


You can also share your feedback on Copilot code review. Take the survey.

@CalinaCristian CalinaCristian marked this pull request as ready for review March 4, 2026 19:22
Copilot AI review requested due to automatic review settings March 4, 2026 19:22
@CalinaCristian CalinaCristian changed the title fix(apollo-wind): attempt to fix prism import issue fix(apollo-wind): fix prism import issues on vitest for consumers Mar 4, 2026
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 2 changed files in this pull request and generated no new comments.


You can also share your feedback on Copilot code review. Take the survey.

@CalinaCristian CalinaCristian reopened this Mar 4, 2026
@CalinaCristian CalinaCristian removed the dev-packages Adds dev package publishing on pushes to this PR label Mar 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants