Skip to content

Problem building a storybook #3

@zakzelman

Description

@zakzelman

Hello, I have a problem when trying to run chpokify on my local machine. As I realized after the test run of the frontend, I need to run storybook as well, because without it I get errors in the browser when I click the "Register" button, here is an example.

Error 1 -thee

font-family: ${({ theme }) => theme.fontFamily?.[0] || 'sans-serif'};

If I try to use a stub on this line, such as this one, I just get another error and this happend time after time. That's when I came to the conclusion that the reason lies in the storybook, but I can't build it either.

I've tried fixing various errors, but that doesn't get me anywhere. Example: After installing all dependencies using the yarn install command, I try to run the yarn storybook:build command suggested in the package.json file

Output:
70% building 138/167 modules 29 active ...lib/index.js??ref--4-0!/home/zakzelman/test-chpokify/chpokify/frontend/.storybook/decorators/themeProvider/index.jsERR! => Failed to build the preview ERR! Module not found: Error: Can't resolve './storeProvider' in '/home/zakzelman/test-chpokify/chpokify/frontend/.storybook/decorators' ERR! ModuleNotFoundError: Module not found: Error: Can't resolve './storeProvider' in '/home/zakzelman/test-chpokify/chpokify/frontend/.storybook/decorators' ERR! at /home/zakzelman/test-chpokify/chpokify/frontend/node_modules/@storybook/builder-webpack4/node_modules/webpack/lib/Compilation.js:925:10 ERR! at /home/zakzelman/test-chpokify/chpokify/frontend/node_modules/@storybook/builder-webpack4/node_modules/webpack/lib/NormalModuleFactory.js:401:22 ERR! at /home/zakzelman/test-chpokify/chpokify/frontend/node_modules/@storybook/builder-webpack4/node_modules/webpack/lib/NormalModuleFactory.js:130:21 ERR! at /home/zakzelman/test-chpokify/chpokify/frontend/node_modules/@storybook/builder-webpack4/node_modules/webpack/lib/NormalModuleFactory.js:224:22 ERR! at /home/zakzelman/test-chpokify/chpokify/frontend/node_modules/neo-async/async.js:2830:7 ERR! at /home/zakzelman/test-chpokify/chpokify/frontend/node_modules/neo-async/async.js:6877:13 ERR! at /home/zakzelman/test-chpokify/chpokify/frontend/node_modules/@storybook/builder-webpack4/node_modules/webpack/lib/NormalModuleFactory.js:214:25 ERR! at /home/zakzelman/test-chpokify/chpokify/frontend/node_modules/enhanced-resolve/lib/Resolver.js:213:14 ERR! at /home/zakzelman/test-chpokify/chpokify/frontend/node_modules/enhanced-resolve/lib/Resolver.js:285:5 ERR! at eval (eval at create (/home/zakzelman/test-chpokify/chpokify/frontend/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:15:1) ERR! at /home/zakzelman/test-chpokify/chpokify/frontend/node_modules/enhanced-resolve/lib/UnsafeCachePlugin.js:44:7 ERR! at /home/zakzelman/test-chpokify/chpokify/frontend/node_modules/enhanced-resolve/lib/Resolver.js:285:5 ERR! at eval (eval at create (/home/zakzelman/test-chpokify/chpokify/frontend/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:15:1) ERR! at /home/zakzelman/test-chpokify/chpokify/frontend/node_modules/enhanced-resolve/lib/Resolver.js:285:5 ERR! at eval (eval at create (/home/zakzelman/test-chpokify/chpokify/frontend/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:27:1) ERR! at /home/zakzelman/test-chpokify/chpokify/frontend/node_modules/enhanced-resolve/lib/DescriptionFilePlugin.js:67:43 ERR! ModuleNotFoundError: Module not found: Error: Can't resolve './storeProvider' in '/home/zakzelman/test-chpokify/chpokify/frontend/.storybook/decorators' ERR! at /home/zakzelman/test-chpokify/chpokify/frontend/node_modules/@storybook/builder-webpack4/node_modules/webpack/lib/Compilation.js:925:10 ERR! at /home/zakzelman/test-chpokify/chpokify/frontend/node_modules/@storybook/builder-webpack4/node_modules/webpack/lib/NormalModuleFactory.js:401:22 ERR! at /home/zakzelman/test-chpokify/chpokify/frontend/node_modules/@storybook/builder-webpack4/node_modules/webpack/lib/NormalModuleFactory.js:130:21 ERR! at /home/zakzelman/test-chpokify/chpokify/frontend/node_modules/@storybook/builder-webpack4/node_modules/webpack/lib/NormalModuleFactory.js:224:22 ERR! at /home/zakzelman/test-chpokify/chpokify/frontend/node_modules/neo-async/async.js:2830:7 ERR! at /home/zakzelman/test-chpokify/chpokify/frontend/node_modules/neo-async/async.js:6877:13 ERR! at /home/zakzelman/test-chpokify/chpokify/frontend/node_modules/@storybook/builder-webpack4/node_modules/webpack/lib/NormalModuleFactory.js:214:25 ERR! at /home/zakzelman/test-chpokify/chpokify/frontend/node_modules/enhanced-resolve/lib/Resolver.js:213:14 ERR! at /home/zakzelman/test-chpokify/chpokify/frontend/node_modules/enhanced-resolve/lib/Resolver.js:285:5 ERR! at eval (eval at create (/home/zakzelman/test-chpokify/chpokify/frontend/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:15:1) ERR! at /home/zakzelman/test-chpokify/chpokify/frontend/node_modules/enhanced-resolve/lib/UnsafeCachePlugin.js:44:7 ERR! at /home/zakzelman/test-chpokify/chpokify/frontend/node_modules/enhanced-resolve/lib/Resolver.js:285:5 ERR! at eval (eval at create (/home/zakzelman/test-chpokify/chpokify/frontend/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:15:1) ERR! at /home/zakzelman/test-chpokify/chpokify/frontend/node_modules/enhanced-resolve/lib/Resolver.js:285:5 ERR! at eval (eval at create (/home/zakzelman/test-chpokify/chpokify/frontend/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:27:1) ERR! at /home/zakzelman/test-chpokify/chpokify/frontend/node_modules/enhanced-resolve/lib/DescriptionFilePlugin.js:67:43 ERR! resolve './storeProvider' in '/home/zakzelman/test-chpokify/chpokify/frontend/.storybook/decorators' ERR! using description file: /home/zakzelman/test-chpokify/chpokify/frontend/package.json (relative path: ./.storybook/decorators) ERR! Field 'browser' doesn't contain a valid alias configuration ERR! using description file: /home/zakzelman/test-chpokify/chpokify/frontend/package.json (relative path: ./.storybook/decorators/storeProvider) ERR! no extension ERR! Field 'browser' doesn't contain a valid alias configuration ERR! /home/zakzelman/test-chpokify/chpokify/frontend/.storybook/decorators/storeProvider doesn't exist ERR! .mjs ERR! Field 'browser' doesn't contain a valid alias configuration ERR! /home/zakzelman/test-chpokify/chpokify/frontend/.storybook/decorators/storeProvider.mjs doesn't exist ERR! .js ERR! Field 'browser' doesn't contain a valid alias configuration ERR! /home/zakzelman/test-chpokify/chpokify/frontend/.storybook/decorators/storeProvider.js doesn't exist ERR! .jsx ERR! Field 'browser' doesn't contain a valid alias configuration ERR! /home/zakzelman/test-chpokify/chpokify/frontend/.storybook/decorators/storeProvider.jsx doesn't exist ERR! .ts ERR! Field 'browser' doesn't contain a valid alias configuration ERR! /home/zakzelman/test-chpokify/chpokify/frontend/.storybook/decorators/storeProvider.ts doesn't exist ERR! .tsx ERR! Field 'browser' doesn't contain a valid alias configuration ERR! /home/zakzelman/test-chpokify/chpokify/frontend/.storybook/decorators/storeProvider.tsx doesn't exist ERR! .json ERR! Field 'browser' doesn't contain a valid alias configuration ERR! /home/zakzelman/test-chpokify/chpokify/frontend/.storybook/decorators/storeProvider.json doesn't exist ERR! .cjs ERR! Field 'browser' doesn't contain a valid alias configuration ERR! /home/zakzelman/test-chpokify/chpokify/frontend/.storybook/decorators/storeProvider.cjs doesn't exist ERR! as directory ERR! /home/zakzelman/test-chpokify/chpokify/frontend/.storybook/decorators/storeProvider doesn't exist error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. error Command failed. Exit code: 1

After investigating this error I came to the conclusion that decorators on the path: /frontend/.storybook/decorators such as storeProvider, routerProvider, centered simply do not exist on this path, they are simply not there. So trying to build something doesn't get me anywhere. I have never encountered storybook before and can only assume that maybe something is generated independently or I am missing something, but this is certainly not the only error. Please help me to solve this problem. Thank you very much.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions