Replies: 4 comments 1 reply
-
@mattupham This is not a panda issue, you need to make your jest configuration find your paths |
Beta Was this translation helpful? Give feedback.
-
Thank you for the quick reply! I've tried the recommendations with moduleNameMapper - haven't got anything to work here yet. Is there anything specific you recommend?
|
Beta Was this translation helpful? Give feedback.
-
@mattupham I'm not too familiar with Jest. Got that after a google search. moduleNameMapper: {
"@styled/(.*)": "<rootDir>/styled-system/*/$1",
} |
Beta Was this translation helpful? Give feedback.
-
Thanks! Unfortunately this didn't work as well. Does Panda have any other recommendation of working with jest, or any examples? |
Beta Was this translation helpful? Give feedback.
-
Description
Jest error with
styled-system
directoryimport { css } from '@styled/css
jest error:
tsconfig:
I've tried all of these steps to attempt a fix:
Jest Issues
https://panda-css.com/docs/overview/faq#why-do-i-get-a-cannot-find-x-module-from-styled-system-error
https://panda-css.com/docs/overview/faq#hmr-does-not-work-when-i-use-tsconfig-paths
semanticTokens don't seem to generate in nx/monorepo/storybook context #988
semanticTokens don't seem to generate in nx/monorepo context #984
Upgrade panda
Remove styled-system / styled system static from gitignore
panda.config.ts - emitPackage: true
Test file mocks (absolute paths)
Test file mocks (relative paths)
Jest manual mocks
Relative imports
Verify moduleNameMapper - pathsToModuleNameMapper is working correctly
Try variations of moduleNameMapper
Jest cache - remove
Add styled-system to include
"include": ["next-env.d.ts", "./src//*.ts", "./src//.tsx", ".next/types/**/.ts", "declarations/.ts", "./styled-system/"],
Test jest resolver for @Style
Link to Reproduction
n/a
Steps to reproduce
JS Framework
React, Nextjs, Typescript
Panda CSS Version
"@pandacss/dev": "^0.28.0",
Browser
Chrome
Operating System
Additional Information
No response
Beta Was this translation helpful? Give feedback.
All reactions