From 7c29355e842f6e6bd49aa0240a6cffdd82d07f15 Mon Sep 17 00:00:00 2001 From: Jeremy Ruppel Date: Wed, 1 Apr 2026 13:44:26 -0400 Subject: [PATCH] fix: specify allowed hosts for storybook dev server (#23938) We recently upgraded storybook and vite in #23485 which bumped our `storybook` version from 10.2.10 to 10.3.3. In 10.2.16, storybookjs/storybook#34045 was merged that changes the list of default allowed hosts to an empty array. This means if you have custom DNS set up (like through the Coder desktop app) your `.coder` domain will no longer be able to reach storybook and you'll get an `Invalid host` response. This is a breaking change, but storybook didn't treat it as such. This PR adds the `core.allowedHosts` config to our storybook dev server. I'm not sure this has the same effect for build so I left the other `viteFinal` `server.allowedHosts` config, but it may be defunct --- site/.storybook/main.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/site/.storybook/main.ts b/site/.storybook/main.ts index b55302ae61..299987770d 100644 --- a/site/.storybook/main.ts +++ b/site/.storybook/main.ts @@ -18,6 +18,10 @@ export default { options: {}, }, + core: { + allowedHosts: [".coder", ".dev.coder.com"], + }, + async viteFinal(config) { // Storybook seems to strip this setting out of our Vite config. We need to // put it back in order to be able to access Storybook with Coder Desktop or