epicweb-dev / full-stack-foundations

Learn the foundational skills of building full stack web applications.

Home Page:https://epicweb.dev/workshops/full-stack-foundations

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

WebSocket connection failed

onemen opened this issue Β· comments

commented

@kentcdodds

This issue triggered by using <LiveReload /> without loading its script with <Scripts />

either remove <LiveReload />

export default function App() {
	return (
		<html lang="en">
			{/* 🐨 Create a <head> here and put Remix's <Links /> in it */}
			<body>
				<p>Hello World</p>
-				<LiveReload />
				<KCDShopIFrameSync />
			</body>
		</html>
	)
}

or add <Scripts />, react throw errors when there is no with head in this case

export default function App() {
	return (
		<html lang="en">
-			{/* 🐨 Create a <head> here and put Remix's <Links /> in it */}
+			<head>{/* 🐨 Put Remix's <Links /> here */}</head>
			<body>
				<p>Hello World</p>
+				<Scripts />
				<LiveReload />
				<KCDShopIFrameSync />
			</body>
		</html>
	)
}```

This is very helpful! I'll think about this... It sure would be annoying to not get live reload until the scripts show up, but I also like adding the scripts later. I think I know what I want to do though. Thanks for researching this!

commented

πŸ‘