Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: (0 , _clamp.default) is not a function #15

Open
TakumaNawata opened this issue Mar 8, 2024 · 1 comment
Open

TypeError: (0 , _clamp.default) is not a function #15

TakumaNawata opened this issue Mar 8, 2024 · 1 comment

Comments

@TakumaNawata
Copy link

Hello, thank you for your great work in advance.
I am using "storybook-addon-module-mock" with "@mui/material" version "5.15.11", an error will occur on storybook.
However, this error did not occur on "5.15.10" or lower.
Do you have any ideas or solutions when using it with "5.15.11" or higher?
The details of the version and error are below.
Thank you.

version:

"storybook": "7.6.17"
"storybook-addon-module-mock": "1.1.5"
"@mui/material": "5.15.11"

error:

TypeError: (0 , _clamp.default) is not a function
    at clampWrapper (http://localhost:6006/vendors-node_modules_babel_runtime_helpers_esm_asyncToGenerator_js-node_modules_babel_runtime-9da363.iframe.bundle.js:32784:29)
    at lighten (http://localhost:6006/vendors-node_modules_babel_runtime_helpers_esm_asyncToGenerator_js-node_modules_babel_runtime-9da363.iframe.bundle.js:33051:17)
    at addLightOrDark (http://localhost:6006/vendors-node_modules_babel_runtime_helpers_esm_asyncToGenerator_js-node_modules_babel_runtime-9da363.iframe.bundle.js:29525:91)
    at augmentColor (http://localhost:6006/vendors-node_modules_babel_runtime_helpers_esm_asyncToGenerator_js-node_modules_babel_runtime-9da363.iframe.bundle.js:29674:5)
    at createPalette (http://localhost:6006/vendors-node_modules_babel_runtime_helpers_esm_asyncToGenerator_js-node_modules_babel_runtime-9da363.iframe.bundle.js:29697:14)
    at createTheme (http://localhost:6006/vendors-node_modules_babel_runtime_helpers_esm_asyncToGenerator_js-node_modules_babel_runtime-9da363.iframe.bundle.js:29800:77)
    at ./src/common/lib/mui/theme.ts (http://localhost:6006/main.iframe.bundle.js:22595:70)
    at __webpack_require__ (http://localhost:6006/runtime~main.iframe.bundle.js:28:33)
    at fn (http://localhost:6006/runtime~main.iframe.bundle.js:321:21)
    at ./src/common/lib/mui/index.ts (http://localhost:6006/main.iframe.bundle.js:22572:64)
error_image
@Demianeen
Copy link

Demianeen commented Sep 15, 2024

Have you tried to add exclude option in main.ts for the storybook-addon-module-mock
plugin? For example like this:

{
	name: 'storybook-addon-module-mock',
	options: {
		exclude: ['**/node_modules/@mui/**'],
	},
},

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants