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: undefined parent_component in Component.ts #8295

Closed
wants to merge 1 commit into from
Closed

fix: undefined parent_component in Component.ts #8295

wants to merge 1 commit into from

Conversation

pierre-cm
Copy link

This change fixes an issue in Component.ts where an error occurs when the parent_component parameter is undefined, causing the following error: "Cannot read properties of undefined (reading '$$')".

The proposed solution is to add a null check to the parent_component parameter before accessing the $$ property.

This change ensures that the code works even when parent_component is not defined, as is the case when importing a module dynamically.

Before submitting the PR, please make sure you do the following

  • It's really useful if your PR references an issue where it is discussed ahead of time. In many cases, features are absent for a reason. For large changes, please create an RFC: https://github.com/sveltejs/rfcs
  • Prefix your PR title with feat:, fix:, chore:, or docs:.
  • This message body should clearly illustrate what problems it solves.
  • Ideally, include a test that fails without this PR but passes with it.

Tests

  • Run the tests with npm test and lint the project with npm run lint

This change fixes an issue in Component.ts where an error occurs when the parent_component parameter is undefined, causing the following error: "Cannot read properties of undefined (reading '$$')".

The proposed solution is to add a null check to the parent_component parameter before accessing the $$ property. 

This change ensures that the code works even when parent_component is not defined, as is the case when importing a module dynamically.
@vercel
Copy link

vercel bot commented Feb 20, 2023

@pierre-cm is attempting to deploy a commit to the Svelte Team on Vercel.

A member of the Team first needs to authorize it.

@vercel
Copy link

vercel bot commented Feb 22, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated
svelte-dev-2 ❌ Failed (Inspect) Feb 22, 2023 at 0:41AM (UTC)

@benmccann
Copy link
Member

Can you share a reproduction of the issue this is fixing?

@baseballyama baseballyama added the awaiting submitter needs a reproduction, or clarification label Feb 22, 2023
@dummdidumm
Copy link
Member

Closing as duplicate of #6646. In general we very likely won't make this change, see #6584 (comment) for the "why".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting submitter needs a reproduction, or clarification
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants