Skip to content

Conversation

@sapphi-red
Copy link
Member

Description

No error happened when accessing variables not exposed in CJS build. This PR adds an error for that, so the user can know what is needed to do.

@sapphi-red sapphi-red added the p3-minor-bug An edge case that only affects very specific usage (priority) label Nov 13, 2024
@sapphi-red sapphi-red added this to the 6.0 milestone Nov 13, 2024
Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>
bluwy
bluwy previously approved these changes Nov 13, 2024
Copy link
Member

@bluwy bluwy left a comment

Choose a reason for hiding this comment

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

Perhaps we can look into a Rollup plugin or a post-build script that ensures the exports are properly implemented in both ESM and CJS, but I think that can be done later.

@sapphi-red
Copy link
Member Author

Added that check (fbcfc1c) 👍

Copy link
Member

@bluwy bluwy left a comment

Choose a reason for hiding this comment

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

Nice!

@sapphi-red sapphi-red merged commit 87c5502 into vitejs:main Nov 13, 2024
15 checks passed
@sapphi-red sapphi-red deleted the feat/show-error-when-accessing-vars-not-expose-in-cjs-build branch November 22, 2024 11:23
moonlitusun pushed a commit to moonlitusun/vite that referenced this pull request May 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

p3-minor-bug An edge case that only affects very specific usage (priority)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants