-
-
Notifications
You must be signed in to change notification settings - Fork 404
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
Volar treats html template as JSX #552
Comments
I guess I have a similar problem, at least in some cases. With Quasar.
|
@sschneider-ihre-pvs Yes, exactly. That's the part of the issue. I got the same errors as well. I tried to prevent JSX parsing a few times but no luck so far. I believe it's Volar enforcing JSX. |
|
@sschneider-ihre-pvs this is a different problem, please open a new issue to track. @ivan-bragin do you have react types in project? what file will navigation to when you ctrl + left click a |
@johnsoncodehk Yes, you are right! For some reason I do =/ But why is this the case? I mean are .vue files being parsed as JSX? Or is it just the limitation of the TS part? |
Okay, I checked and it seems that this |
@ivan-bragin after 0.27.27, template virtual code is changed to JSX to improve generic component support.
I will take a look. But not sure it can fix, maybe you must config tsconfig to fix, see #111 (comment). |
@johnsoncodehk I'll try this fix, thanks a lot! Honestly, it's not that big, but the combination with the error @sschneider-ihre-pvs mentioned, it lights up half of my files as if there are errors inside. If you'll manage to fix this, I'll become a sponsor xD btw: @sschneider-ihre-pvs That's a link for you storybookjs/storybook#16213 |
Just tried the suggested fix, seems working at the first glance, but I'll test it some more. |
done |
@sschneider-ihre-pvs the suggested fix with "types" also fixes the VLS issue. Can you try that as well? |
No, it seems to be a different issue, |
Unfortunately, based on JSX, there is no non-invasive solution. If there is |
@johnsoncodehk Oh well. That's unfortunate but not that bad I guess. Can this information be added to the setup documentation? Since this |
@ivan-bragin of course, will update docs for this. |
* chore(deps): lock file maintenance * fix(Vue-vite): remove `@types/react` from vite issue vuejs/language-tools#552. Co-authored-by: Renovate Bot <[email protected]> Co-authored-by: sabertazimi <[email protected]>
* chore(deps): lock file maintenance * fix(Vue-vite): remove `@types/react` from vite issue vuejs/language-tools#552. Co-authored-by: Renovate Bot <[email protected]> Co-authored-by: sabertazimi <[email protected]> c868192
Still having the same issue. {
"compilerOptions": {
"target": "es5",
"module": "esnext",
"strict": true,
"importHelpers": true,
"moduleResolution": "node",
"resolveJsonModule": true,
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"sourceMap": true,
"allowJs": true,
"baseUrl": ".",
"typeRoots": ["@typings"],
"types": ["jest", "node"],
"paths": {
"@/*": ["src/*"]
},
"lib": ["esnext", "dom", "dom.iterable", "scripthost"]
},
"include": ["src/**/*.ts", "src/**/*.vue", "@typings"],
"exclude": ["node_modules"]
} |
@Blackfaded please try https://github.com/johnsoncodehk/volar-starter/blob/master/tsconfig.json. If the problem still on, please provide a repro case. |
The config sadly did not resolve my issue. I will try to setup a repo in the next days! |
@Blackfaded I learned in Discord that pnpm may encounter this problem, and adding |
Fixed in 564af29. |
It works for components. But still warnings on
|
@euaaaio please open a new issue and provide a repro case. |
Solved it by excluding |
Please move to #592 for related problems. |
this can solve my "class" problem |
I couldn't get any of the answers here to work, but what finally worked for me was to just add this to my compilerOptions in tsconfig.json: {
"paths": {
"react": [ "" ]
}
} My hope was that it would cause any attempts to load react types to fail and that seems to be what's happened. You will need to use a different tsconfig file to run storybook files, though. I did have mild success with making the |
The text was updated successfully, but these errors were encountered: