question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

0.38.8 broke absolute and aliased imports

See original GitHub issue

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"),
    },
  },
}

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:11
  • Comments:15 (4 by maintainers)

github_iconTop GitHub Comments

5reactions
Evertvdwcommented, Jul 18, 2022

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.

1reaction
mmusketcommented, 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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Typescript cannot find module using @ root path syntax in ...
Open App.vue and change an import to use @/ root path syntax. E.g. import TheWelcome ... 0.38.8 broke absolute and aliased imports #1585....
Read more >
Absolute Imports and Module Path Aliases
Configure module path aliases that allow you to remap certain import paths. ... a common pattern is aliasing certain directories to use absolute...
Read more >
Resolve Absolute / Alias Imports in Components with ...
I'm using gatsby-plugin-alias-imports to be able to do absolute imports like so: import { colors } from "@styles/theme"; This is set up in ......
Read more >
Avoiding the Fear of Refactoring With Absolute Imports in ...
Let's see how to use absolute path aliases to make your imports refactor-friendly in React. Avoiding relative paths and broken links while ...
Read more >
Configuring Absolute Imports in React and React Native with ...
There are two great reasons to move to absolute imports. One is to avoid long relative paths, and the other is to make...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found