torchbox / storybook-django

Develop Django UI components in isolation, with Storybook
MIT License
109 stars 8 forks source link

This project no longer runs correctly #13

Closed ay13 closed 2 months ago

ay13 commented 1 year ago

Describe the bug

When I start this project to demo its capabilities, it does not proxy the rendered markup into storybook.

I have the Django project running and the storybook running.

Environment

Mac Sonoma Python 3.9.18

Steps to reproduce

(Write your steps here:)

  1. Clone or download code for project
  2. python -m venv --prompt sb .venv
  3. source .venv/bin/activate
  4. pip install -r requirements.txt
  5. npm install
  6. python manage.py runserver 0:8001
  7. npm run start

Expected behavior

I expected to be able to navigate the Storybook and see the components

Actual behavior

I receive this error in Storybook Error occurred while trying to proxy: localhost:6006/pattern-library/api/v1/render-pattern

image

thibaudcolas commented 3 months ago

Hi @ay13, I’ve been through those exact steps and the project still runs the same as ever. Exact steps as yours. Thinking of possible issues, it could be the Node version you’re using? See https://github.com/nodejs/node/issues/40537

Django’s development server only serves on IPv4 I believe, while Node will be resolving localhost to an IPv6 address.

If this is the possible culprit, try on a recent Node version and see what happens? You can also export TEST_ORIGIN=http://127.0.0.1:8001 to force Node querying the IPv4 address.