michaelwooley / storybook-experimental-vite

8 stars 3 forks source link

Ensure storybook can build and that the built files can be served #9

Closed michaelwooley closed 1 year ago

michaelwooley commented 2 years ago

As of #7 , it looks like the storybook-build script runs to completion.

However, errors pop up when attempting to serve the files:

❯ npx http-server ./storybook-static
Starting up http-server, serving ./storybook-static

http-server version: 14.1.1

http-server settings: 
CORS: disabled
Cache: 3600 seconds
Connection Timeout: 120 seconds
Directory Listings: visible
AutoIndex: visible
Serve GZIP Files: false
Serve Brotli Files: false
Default File Extension: none

Available on:
  http://127.0.0.1:8080
  http://192.168.1.92:8080
Hit CTRL-C to stop the server

[2022-07-06T16:22:11.288Z]  "GET /" "Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Firefox/102.0"
(node:26146) [DEP0066] DeprecationWarning: OutgoingMessage.prototype._headers is deprecated
(Use `node --trace-deprecation ...` to show where the warning was created)
[2022-07-06T16:22:14.949Z]  "GET /" "Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Firefox/102.0"
[2022-07-06T16:22:15.053Z]  "GET /favicon.ico" "Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Firefox/102.0"
[2022-07-06T16:22:19.502Z]  "GET /7.480c60c60f21bf435941.manager.bundle.js" "Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Firefox/102.0"
[2022-07-06T16:22:19.503Z]  "GET /7.480c60c60f21bf435941.manager.bundle.js" Error (404): "Not found"
[2022-07-06T16:22:19.538Z]  "GET /iframe.html?viewMode=story&id=*" "Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Firefox/102.0"
[2022-07-06T16:22:19.538Z]  "GET /iframe.html?viewMode=story&id=*" Error (404): "Not found"
gbkwiatt commented 2 years ago

Any progress here ? Currently it does not work with latest sveltekit either. Works when running dev storybook, but upon build - it does not generate correct build (missing iframe file)

michaelwooley commented 2 years ago

@gbkwiatt if you provide a sample repo + command output, I can look into it.

You should probably just try going through storybook directly: "Install Storybook".

See this PR:

https://github.com/svelte-add/svelte-add/pull/220

In short, svelte-add isn't creating a seperate adder because SB has done that already. This appears to have occurred shortly after I set this repo down.

If it works, let me know and I'll archive this + add a pointer in readme.

benmccann commented 1 year ago

sb init works by setting up the SvelteKit framework for Storybook (https://github.com/storybookjs/storybook/tree/next/code/frameworks/sveltekit) and does work in build mode, so that's what I'd recommend