Closed richpjames closed 2 months ago
This doesn't seem to work, we get the following error in Chrome TypeError: Failed to resolve module specifier "socket.io-client". Relative references must start with either "/", "./", or "../".
This doesn't seem to work, we get the following error in Chrome
TypeError: Failed to resolve module specifier "socket.io-client". Relative references must start with either "/", "./", or "../".
This confused me too, but I think it's because we import io
from Socket.IO. import { type Socket, io }
means import the Socket
type but io
for real. I misread it for a while!
This package is imported via index.html and we are just using the types here. But if we don't tell the bundler that it's externally imported it then it will add it to the bundled code making a bigger and harder to scan bundle. Docs: https://bun.sh/docs/bundler#external