Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: tolerate undefined parent in hookNodeResolve callback #5664

Merged
merged 1 commit into from
Nov 12, 2021

Conversation

aleclarson
Copy link
Member

@aleclarson aleclarson commented Nov 12, 2021

The parent module is undefined when a ESM module imports a CJS module. At this point, the id string is already an absolute path, so just return it.

This fixes a crash reported by SvelteKit and Shopify Hydrogen maintainers.

The parent module is undefined when a ESM module imports a CJS module. At this point, the `id` string is already an absolute path, so just return it.
@aleclarson aleclarson added the p5-urgent Fix build-breaking bugs affecting most users, should be released ASAP (priority) label Nov 12, 2021
@patak-dev patak-dev merged commit d788682 into vitejs:main Nov 12, 2021
@zhangyuang
Copy link
Contributor

perfect,otherwise ssr playground run error in development

@patak-dev
Copy link
Member

Thanks for the PRs you have been working on lately @zhangyuang!

@aleclarson aleclarson deleted the fix/ssr-resolve-undefined-parent branch February 25, 2022 20:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p5-urgent Fix build-breaking bugs affecting most users, should be released ASAP (priority)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants