-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
According to the documentation the apiPath
passed to createDjangoAPIMiddleware
is a list of strings, but this raises a type error: e.split is not a function
. I don't know much about server-side JavaScript, but I guess that the error is in that router.use
expects a string, not a list.
After changing apiPath
to a string storybook starts fine. I have not yet gotten around to adding a Django story though.
Which terms did you search for in the documentation and issue tracker?
- "type error"
Steps to reproduce
(Write your steps here:)
- Set up a Django project with working django-pattern-library integration
- Add storybook to the project and confirm that it works (
npm run storybook
) - Add storybook-django to the project (according to
package-lock.json
I have version 1.0.0 installed) - Configure the middleware according to the documentation
- Run
npm run storybook
Expected behavior
Storybook should start with apiPath
as a list.
Actual behavior
The type error was raised.
$ npm run storybook
> my-project@0.0.0 storybook
> storybook dev -p 6006
storybook v9.0.8
[HPM] Proxy created: / -> http://localhost:8000
TypeError: e.split is not a function
at parse (./node_modules/storybook/dist/core-server/index.cjs:35926:41)
at e.use (./node_modules/storybook/dist/core-server/index.cjs:35961:63)
at e.use (./node_modules/storybook/dist/core-server/index.cjs:36001:135)
at middleware (./node_modules/storybook-django/src/middleware.js:24:12)
at storybookDevServer (./node_modules/storybook/dist/core-server/index.cjs:36738
at async buildOrThrow (./node_modules/storybook/dist/core-server/index.cjs:35372
at async buildDevStandalone (./node_modules/storybook/dist/core-server/index.cjs
at async withTelemetry (./node_modules/storybook/dist/core-server/index.cjs:3612
at async dev (./node_modules/storybook/dist/cli/bin/index.cjs:5906:3)
at async s.<anonymous> (./node_modules/storybook/dist/cli/bin/index.cjs:6084:74)
WARN Broken build, fix the error above.
WARN You may need to refresh the browser.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working