Closed mattupham closed 8 months ago
@mattupham This is not a panda issue, you need to make your jest configuration find your paths https://jestjs.io/docs/configuration#modulenamemapper-objectstring-string--arraystring
@mattupham This is not a panda issue, you need to make your jest configuration find your paths https://jestjs.io/docs/configuration#modulenamemapper-objectstring-string--arraystring
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?
@mattupham I'm not too familiar with Jest. Got that after a google search. You can try something like this
moduleNameMapper: {
"@styled/(.*)": "<rootDir>/styled-system/*/$1",
}
@mattupham I'm not too familiar with Jest. Got that after a google search. You can try something like this
moduleNameMapper: { "@styled/(.*)": "<rootDir>/styled-system/*/$1", }
Thanks! Unfortunately this didn't work as well. Does Panda have any other recommendation of working with jest, or any examples?
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
https://github.com/chakra-ui/panda/discussions/988
https://github.com/chakra-ui/panda/issues/984
[x] Upgrade panda
[x] Remove styled-system / styled system static from gitignore
[x] panda.config.ts - emitPackage: true
[x] Test file mocks (absolute paths)
[x] Test file mocks (relative paths)
[x] Jest manual mocks
[x] Relative imports
[x] Verify moduleNameMapper - pathsToModuleNameMapper is working correctly
[x] Try variations of moduleNameMapper
[x] Jest cache - remove
[x] Add styled-system to include
[x] "include": ["next-env.d.ts", "./src//*.ts", "./src/*/.tsx", ".next/types//.ts", "declarations/.ts", "./styled-system/*"],
[x] 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