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

Refactor Quickstart component to prevent error #4030

Merged
merged 2 commits into from
Sep 6, 2023

Conversation

john-rock
Copy link
Contributor

What are you changing in this pull request and why?

Fixes the Node.removeChild: The node to be removed is not a child of this node error we were seeing when trying to use a Snippet with a nested component.

Additional information

The following code was setup to make sure that in the event a snippet that is nested under a step (##) in the quickstart markdown file contained an h2 (##) it would not be rendered as an additional step.

      snippetContainer.forEach((snippet) => {
        const parent = snippet?.parentNode;
        while (snippet?.firstChild && parent.className) {
          if (parent) {
            parent.insertBefore(snippet.firstChild, snippet);
          }
        }
      });

Since the update core quickstart contains a snippet in Step 8 <Snippet path="tutorial-sql-query" /> which contains a nested component <WHcode /> it was causing the component to break when building the steps.

This PR makes sure the component is fully loaded before attempting any manipulation on the steps.

@john-rock john-rock requested a review from a team as a code owner September 6, 2023 20:40
@github-actions github-actions bot added the size: small This change will take 1 to 2 days to address label Sep 6, 2023
@netlify
Copy link

netlify bot commented Sep 6, 2023

Deploy Preview for docs-getdbt-com ready!

Name Link
🔨 Latest commit b7fffb9
🔍 Latest deploy log https://app.netlify.com/sites/docs-getdbt-com/deploys/64f8e412819843000818cbe6
😎 Deploy Preview https://deploy-preview-4030--docs-getdbt-com.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 site configuration.

@john-rock john-rock changed the title make sure component is mounted first Refactor Quickstart component to prevent error Sep 6, 2023
@john-rock john-rock requested a review from mirnawong1 September 6, 2023 20:49
Copy link
Collaborator

@runleonarun runleonarun left a comment

Choose a reason for hiding this comment

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

I am no longer seeing any errors! Thank you!

@runleonarun runleonarun merged commit 46201ef into mwong-breakdown-core-qs Sep 6, 2023
8 checks passed
@runleonarun runleonarun deleted the fix-qs-hydration-error branch September 6, 2023 20:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size: small This change will take 1 to 2 days to address
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants