Skip to content

vue: add jest testing hints on imports and add exports to package.json#2568

Open
lucas-koehler wants to merge 2 commits intomasterfrom
lk/2250-vue-test-import-order-doc
Open

vue: add jest testing hints on imports and add exports to package.json#2568
lucas-koehler wants to merge 2 commits intomasterfrom
lk/2250-vue-test-import-order-doc

Conversation

@lucas-koehler
Copy link
Copy Markdown
Contributor

@lucas-koehler lucas-koehler commented Apr 16, 2026

  • Add documentation on import order for jest (or other) unit tests using CJS transformations
  • Add explicit exports property to vue's package.json to facilitate tools finding the correct bundle

Closes #2250

- Add documentation on import order for jest (or other) unit tests using CJS transformations
- Add explicit `exports` property to vue's package.json to facilitate tools finding the correct bundle

Mitigates #2250
@netlify
Copy link
Copy Markdown

netlify bot commented Apr 16, 2026

Deploy Preview for jsonforms-examples ready!

Name Link
🔨 Latest commit fe0d531
🔍 Latest deploy log https://app.netlify.com/projects/jsonforms-examples/deploys/69e1016530262c0007c74450
😎 Deploy Preview https://deploy-preview-2568--jsonforms-examples.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@coveralls
Copy link
Copy Markdown

coveralls commented Apr 16, 2026

Coverage Status

coverage: 82.957%. remained the same — lk/2250-vue-test-import-order-doc into master

@lucas-koehler
Copy link
Copy Markdown
Contributor Author

lucas-koehler commented Apr 16, 2026

The "exports" seems to have caused test issues on windows and mac 😅

Reason:
The exports field is strict and relies on accurate realpath() resolution to determine package identity and resolve relative entry points. In a pnpm workspace monorepo, where packages are symlinked (or junction-linked on Windows), this resolution has subtle cross-platform differences that can cause the exports map to either fail entirely or resolve to the wrong bundle format — while the more lenient main/module fallback works reliably on all platforms.

This is a known category of issue in the Node.js ecosystem — exports + workspace symlinks + cross-platform is a notorious combination. Removing the exports field was the pragmatic fix.

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.

Jest tests depend on order of imports for defineComponent

2 participants