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

0.38.8 broke absolute and aliased imports #1585

Closed
2-5 opened this issue Jul 17, 2022 · 15 comments
Closed

0.38.8 broke absolute and aliased imports #1585

2-5 opened this issue Jul 17, 2022 · 15 comments

Comments

@2-5
Copy link
Contributor

2-5 commented Jul 17, 2022

Upgrade to 0.38.8 broke absolute and aliased imports. The code compiles and works fine, but shows errors in Volar:

import

tsconfig.json:

{
  "compilerOptions": {
    "baseUrl": ".",
    "paths": {
      "@/*": ["src/*"],
    }
  },

  "include": [
    "src/**/*.ts",
    "src/**/*.vue",
  ],
}

webpack.js:

const path = require("path")

module.exports = {
  resolve: {
    modules: ["node_modules", "src"],
    extensions: [".ts", ".js"],
    alias: {
      "@": path.resolve(__dirname, "src"),
    },
  },
}
@gitlilimin
Copy link

This problem also bothered me all day, you can try rollback to 0.38.5

i think this problem related to this commit

@johnsoncodehk
Copy link
Member

I can't reproduce this problem, could your provide minimal reproduction?

@2-5
Copy link
Contributor Author

2-5 commented Jul 17, 2022 via email

@gitlilimin
Copy link

@johnsoncodehk i make a reproduction in #894

@DCLangX
Copy link

DCLangX commented Jul 18, 2022

I have the same problem😭since volar updated today

@marty0678
Copy link

I'm not 100% if these two issues are related, but I'm getting similar TypeScript errors once I start editing a file since upgrading to 0.38.7 or 0.38.8 (these issues are not present on 0.38.6):

  1. Open a file, everything is linted correctly, no errors, etc
  2. Make a change, for example add const props = infront of defineProps

In the above example, you get the following result:
image

As you can see, the syntax highlighting is pretty odd indeed!

Another example of just odd behavior is take a component such as:
image

And add another simple component, and you see you get a TS error instantly, on the rest of the component that seems to have nothing to do with the change.
image

If you reload VsCode at this point, all the linting/errors for both issues go away, until you make another change.

I saw this issue was recent and was related to TypeScript issues, so if this should be a separate issue please let me know.

Thank you!

(I will revert to 0.38.6 for now as the issues do not happen there, I'm on Windows 11, VsCode 1.69.1, and using .vue and .js files (no typescript in my project specifically))

@Evertvdw
Copy link
Contributor

Having the same issue as the post starter, I'm also on Windows, version 0.38.6 is the last version that works correctly for me.

@mmusket
Copy link

mmusket commented Jul 19, 2022

Also running same issue with latest version on windows

Just to add a datapoint
Problem happens for import links for .ts files inside of .vue files only

Example

File.vue 
import { xx} from '@/components/comp.vue' 
works ok

import { yy } from '@/store/store' 
throws ts(2307) 

Rolled back to 0.38.6

@tangerren
Copy link

image

in v0.38.8
i have the same problem

@chenjiangui
Copy link

me to

@lautr
Copy link

lautr commented Jul 19, 2022

Having the same Problem with the following Setup

  • Monorepo using pnpm
  • 2 x Vue3 Projects
  • Using Windows 10

Path aliases for one project work, for the other they don't.

Had the Issue with v0.38.8 & v0.38.7
Rolling back v0.38.6 seems to work.

@tajima738
Copy link

I am having the same issue.

  • Windows 11
  • v0.38.6 is fine
  • We can build without problem
  • Our Vue project files are in a subdirectory, opening the subdirectory directly in VSCode seems to work fine.

@szulcus
Copy link

szulcus commented Jul 19, 2022

I have the same problem
image

@2-5
Copy link
Contributor Author

2-5 commented Oct 11, 2022 via email

@johnsoncodehk
Copy link
Member

@2-5 please open a new issue and provide repro case if still have this problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests