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: Cannot read properties of undefined (reading 'message') #64

Open
drphelps opened this issue Apr 26, 2024 · 9 comments
Open

Comments

@drphelps
Copy link

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.

Oops! Something went wrong! :(

ESLint: 8.57.0

TypeError: Cannot read properties of undefined (reading 'message')
Occurred while linting /Users/redacted/components/dialog.tsx:393
Rule: "@pandacss/no-unsafe-token-fn-usage"
    at syncFn (/Users/redacted/node_modules/synckit/lib/index.cjs:352:59)
    at /Users/redacted/node_modules/@pandacss/eslint-plugin/dist/index.js:8068:34
    at Array.filter (<anonymous>)
    at getImports (/Users/redacted/node_modules/@pandacss/eslint-plugin/dist/index.js:8068:18)
    at isPandaIsh (/Users/redacted/node_modules/@pandacss/eslint-plugin/dist/index.js:8076:19)
    at isInPandaFunction (/Users/redacted/node_modules/@pandacss/eslint-plugin/dist/index.js:8149:8)
    at isPandaAttribute (/Users/redacted/node_modules/@pandacss/eslint-plugin/dist/index.js:8167:20)
    at Property (/Users/redacted/node_modules/@pandacss/eslint-plugin/dist/index.js:9170:14)
    at ruleErrorHandler (/Users/redacted/node_modules/eslint/lib/linter/linter.js:1076:28)
    at /Users/redacted/node_modules/eslint/lib/linter/safe-emitter.js:45:58
@anubra266
Copy link
Collaborator

@drphelps Could you make a small repro sandbox/repo for this. I'm finding it hard to reproduce it on my end

@sanjaytwisk
Copy link

Running into the same issue on Github Actions. The error pops up sporadically and at random. Never happens within my local development environment.

@anubra266
Copy link
Collaborator

@sanjaytwisk do you have a minimal repro. @drphelps 's repro is quite complicated. I can't even get the project to run

@Darmody
Copy link

Darmody commented May 1, 2024

Have the same problem here too.

@anubra266
Copy link
Collaborator

A minimal repro please @Darmody I need something to test and debug with

@anubra266 anubra266 closed this as not planned Won't fix, can't repro, duplicate, stale May 4, 2024
@anubra266 anubra266 reopened this May 4, 2024
@sanjaytwisk
Copy link

@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

@sanjaytwisk
Copy link

@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?

@anubra266
Copy link
Collaborator

@sanjaytwisk I've pushed a fix for the backtick issue

@drphelps
Copy link
Author

drphelps commented May 8, 2024

@drphelps could this be the same for you?

I ran into the backtick issue as well but that throws a different error than above. Thanks for addressing that one, @anubra266.

Oops! Something went wrong! :(

ESLint: 8.57.0

TypeError: Cannot read properties of undefined (reading 'replace')
Occurred while linting /Users/redacted/layout.tsx:36
Rule: "@pandacss/no-unsafe-token-fn-usage"
...

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.

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

4 participants