nuxt-modules / nuxt-modules/color-mode

Color-mode throws error in a static storybook build

Open
#116 1 comment 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
TypeScript
Stars
1.2k
Forks
123
Avg merge
3h 57m
Merged PRs (30d)
9

Description

Version
  • @nuxtjs/color-mode: 2.1.1
  • @nuxtjs/storybook: 4.2.0
  • nuxt: 2.15.8
Reproduction Link

GitHub repository that can reproduce the bug: https://github.com/wetendorff/nuxt-storybook-colormode-bug

Steps to reproduce
npm install
npm run storybook:build
npx http-server storybook-static/
What is Expected?

Same result as:

npm run storybook
What is actually happening?

Fails with error:

colorMode is undefined

plugin_client@http://127.0.0.1:8080/main.ad4abd53.iframe.bundle.js:1:55263
_callee2$@http://127.0.0.1:8080/main.ad4abd53.iframe.bundle.js:1:62178
tryCatch@http://127.0.0.1:8080/vendors~main.a248c2cf.iframe.bundle.js:2:484186
invoke@http://127.0.0.1:8080/vendors~main.a248c2cf.iframe.bundle.js:2:483817
defineIteratorMethods/</<@http://127.0.0.1:8080/vendors~main.a248c2cf.iframe.bundle.js:2:484961
asyncGeneratorStep@http://127.0.0.1:8080/vendors~main.a248c2cf.iframe.bundle.js:2:405102
_next@http://127.0.0.1:8080/vendors~main.a248c2cf.iframe.bundle.js:2:405422

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked reproduction repository and run npm install, npm run storybook:build, and npx http-server storybook-static/. Compare the static build with npm run storybook, then trace where colorMode becomes undefined; done means the static Storybook build produces the same result without the error.

Written by the indexing model from the issue text.

Assessment

Tech stack
nuxtjs, typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.