Skip to content

Commit

Permalink
missed an update
Browse files Browse the repository at this point in the history
  • Loading branch information
wizardlyhel committed Jan 10, 2025
1 parent eac00ea commit 19f60fd
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion examples/express/app/root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,18 @@ import type {Cart, Shop} from '@shopify/hydrogen/storefront-api-types';
import styles from './styles/app.css?url';
import {useNonce} from '@shopify/hydrogen';

/**
* The main and reset stylesheets are added in the Layout component
* to prevent a bug in development HMR updates.
*
* This avoids the "failed to execute 'insertBefore' on 'Node'" error
* that occurs after editing and navigating to another page.
*
* It's a temporary fix until the issue is resolved.
* https://github.com/remix-run/remix/issues/9242
*/
export const links: LinksFunction = () => {
return [
{rel: 'stylesheet', href: styles},
{
rel: 'preconnect',
href: 'https://cdn.shopify.com',
Expand Down Expand Up @@ -75,6 +84,7 @@ export function Layout({children}: {children?: React.ReactNode}) {
<head>
<meta charSet="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<link rel="stylesheet" href={styles}></link>
<Meta />
<Links />
</head>
Expand Down

0 comments on commit 19f60fd

Please sign in to comment.