-
-
Notifications
You must be signed in to change notification settings - Fork 32
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
The prop value with an expression type of MetaProperty
could not be resolved
#119
Comments
Can you provide any JS code that leads to this? I'm not sure what a MetaProperty is. |
I am not sure what |
MetaProperty
could not be resolved
ahh maybe |
Sorry for the late response. Yes, I have usages of |
gotcha, thanks. I'll see if I can reproduce it in a test case. (weird tho, i'd expect |
Hmm, tests are passing - make sure you're using the latest Babel parser? |
I am pretty sure that I have the latest of babel everything, as I am quite diligent in updating dev dependencies (including transitive deps by performing partial refreshes of the lockfile). I saw this issue in the logs of the lint output today, so I somewhat doubt it's an issue with an old babel version (sorry if this isn't super helpful, just AFK right now!) |
no worries, more repro info would be helpful when you're back at a computer :-) |
This error also occurred for me when using import.meta in a typescript project using vite. |
I was also bumping into this warning. In my case this results in the message:
Changing it to:
makes it go away. |
@mark-meyer thanks, that's helpful! |
@mark-meyer actually we already have this example in tests, which are passing. what version of jsx-ast-utils and the babel parser are you using? |
This comment was marked as off-topic.
This comment was marked as off-topic.
@joaofmartinho same thing, a repro case would be helpful. |
This warning is appearing in a project I'm working on due to the following TSX code snippet: <LogoType
width={80}
height={11}
aria-label={import.meta.env.VITE_PRODUCT_NAME || "Element Call"}
/> jsx-ast-utils is at 3.3.5, and @babel/parser is at either 7.23.0 or 7.22.16 (not sure, there are apparently two versions floating around in my node_modules) Sorry that I don't have the time to turn this into a more minimal reproduction case right now, but you should be at least able to reproduce by cloning this repository, then running |
I came here from a Google search, same issue in another project. I will create a minimal repo to reproduce an link it here. |
Here is a repo to reproduce this issue: https://github.com/receter/meta-property-could-not-be-resolved The key is that I have replaced the eslint config with just: module.exports = {
"extends": ["react-app"],
} With the original config provided by vite, this does not happen. My other project was created with Vite 4.2.0 and eslint was added later on manually. For me the fix will likely be to change my eslint config to what is recommended by Vite. |
In my case the warning is coming from the package jsx-eslint/eslint-plugin-jsx-a11y that has jsx-ast-utils as a dependency. |
@joaofmartinho thanks, that's a good workaround - it should really be fixed here tho. |
I commented on this issue almost a year ago but overlooked the solution. Now that I found the solution by myself by figuring out that it was the |
The text was updated successfully, but these errors were encountered: