-
Notifications
You must be signed in to change notification settings - Fork 5
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: Cannot read properties of undefined (reading 'message') #64
Comments
@drphelps Could you make a small repro sandbox/repo for this. I'm finding it hard to reproduce it on my end |
Running into the same issue on Github Actions. The error pops up sporadically and at random. Never happens within my local development environment. |
@sanjaytwisk do you have a minimal repro. @drphelps 's repro is quite complicated. I can't even get the project to run |
Have the same problem here too. |
A minimal repro please @Darmody I need something to test and debug with |
@anubra266 Unfortunately I cannot share the repository that I'm working on. I tried to create a basic repo with NextJS and PandaCSS but so far I'm not able to reproduce the bug. Hope I'll find a way soon, keep you updated |
@anubra266 I ran into a similar problem when using back ticks instead of quotes: styled('div', {
height: `var(--max-height)`,
}) @drphelps could this be the same for you? |
@sanjaytwisk I've pushed a fix for the backtick issue |
I ran into the backtick issue as well but that throws a different error than above. Thanks for addressing that one, @anubra266.
I'm still working on coming up with a simple reproduction of the original error but it's difficult to trace where it's coming from. |
It happens randomly in different parts of the code when running the local server. Each time this error occurs, the file and line are different (sometimes the error file does not use panda). Today it reports an error in onChange, but next time it will be a different file and line, or even a different panda eslint rule. |
I'm running into this issue both locally and on github CI (using versions
and (running on the same code, without any changes)
|
I met same problem in production code. This eslint plugin is crashed when This problem occurs randomly. |
@anubra266 I've created reproduce repository using chakra-ui/panda repo. How to reproduce
git clone https://github.com/azu/eslint-plugin-panda-issues-64
cd eslint-plugin-panda-issues-64
for i in {1..1000}
do
pnpm run lint:website > /dev/null
if [ $? -eq 2 ]; then
break
fi
done Crash @pandacss/eslint-plugin randomly. > eslint website/src --ext .tsx
Oops! Something went wrong! :(
ESLint: 8.56.0
TypeError: Cannot read properties of undefined (reading 'message')
Occurred while linting /Users/azu/ghq/github.com/chakra-ui/panda/website/src/nextra/framework-card.tsx:99
Rule: "@pandacss/no-invalid-token-paths"
at syncFn (/Users/azu/ghq/github.com/chakra-ui/panda/node_modules/.pnpm/synckit@0.9.0/node_modules/synckit/lib/index.cjs:352:59)
at /Users/azu/ghq/github.com/chakra-ui/panda/node_modules/.pnpm/@pandacss+eslint-plugin@0.1.5_eslint@8.56.0_jsdom@24.0.0_typescript@5.3.3/node_modules/@pandacss/eslint-plugin/dist/index.js:8060:34
at Array.filter (<anonymous>)
at getImports (/Users/azu/ghq/github.com/chakra-ui/panda/node_modules/.pnpm/@pandacss+eslint-plugin@0.1.5_eslint@8.56.0_jsdom@24.0.0_typescript@5.3.3/node_modules/@pandacss/eslint-plugin/dist/index.js:8060:18)
at isPandaIsh (/Users/azu/ghq/github.com/chakra-ui/panda/node_modules/.pnpm/@pandacss+eslint-plugin@0.1.5_eslint@8.56.0_jsdom@24.0.0_typescript@5.3.3/node_modules/@pandacss/eslint-plugin/dist/index.js:8068:19)
at isInPandaFunction (/Users/azu/ghq/github.com/chakra-ui/panda/node_modules/.pnpm/@pandacss+eslint-plugin@0.1.5_eslint@8.56.0_jsdom@24.0.0_typescript@5.3.3/node_modules/@pandacss/eslint-plugin/dist/index.js:8143:8)
at isPandaAttribute (/Users/azu/ghq/github.com/chakra-ui/panda/node_modules/.pnpm/@pandacss+eslint-plugin@0.1.5_eslint@8.56.0_jsdom@24.0.0_typescript@5.3.3/node_modules/@pandacss/eslint-plugin/dist/index.js:8161:20)
at Property (/Users/azu/ghq/github.com/chakra-ui/panda/node_modules/.pnpm/@pandacss+eslint-plugin@0.1.5_eslint@8.56.0_jsdom@24.0.0_typescript@5.3.3/node_modules/@pandacss/eslint-plugin/dist/index.js:8829:14)
at ruleErrorHandler (/Users/azu/ghq/github.com/chakra-ui/panda/node_modules/.pnpm/eslint@8.56.0/node_modules/eslint/lib/linter/linter.js:1076:28)
at /Users/azu/ghq/github.com/chakra-ui/panda/node_modules |
@azu just released a new version. Could you confirm if your scenario persists? Thanks |
@anubra266 Thanks for quick response. env:
azu/eslint-plugin-panda-issues-64@fbb456b
Another large production code has similar errors occurring randomly.
|
@azu The unreliable behaviour is coming from within synckit, so i've just wrapped synckit to prevent the unrelated errors from propagating to our linting. Should be fine now. |
@anubra266 Thanks! I've tested it and it does not crash anymore! Thanks for the hard work! |
synckit throws sporadic errors where the message port returns
undefined
. I thought this issue was related to Yarn PnP but the same error occurs with traditional node_modules. I've run into the error in both Node v18.20.2 and v20.12.2.The text was updated successfully, but these errors were encountered: