Skip to content

javascript: imports through a vite.config resolve.alias ('@/…') never resolve #1746

Closed

Description

@swapnilpaliwal-sd

Symptom: an import through a bundler alias declared only in vite.config.js (resolve.alias: { '@': path.resolve(__dirname, './src') }) never resolves, so every call through it is ambiguous_unknown and impact on the imported helper says "nothing the graph can see". There's no jsconfig.json, which is the usual setup for Vite and Vue apps.

Repro:

// vite.config.js
export default defineConfig({ resolve: { alias: { '@': path.resolve(__dirname, './src') } } });
// src/utils/date.js
export function fmtDate(d) { return String(d); }
// src/pages/Home.js
import { fmtDate } from '@/utils/date';
fmtDate(1);

axiomcode impact fmtDate

Expected: Home.js:2 is a resolved caller.
Actual: no callers. This was seen on a synthetic case and on a real Vue app, where formatDate in src/common/format.js shows no callers although several components call it through @/common/format.

Activity

  1. swapnilpaliwal-sd commented on Sep 29, 2026

    @swapnilpaliwal-sd
    ContributorAuthor

    This issue now tracks 2 related issues about JavaScript import aliases from bundler and framework configs (#1756, #1757). Those issues are closed as duplicates of this one; each keeps its own description and reproduction. The group is fixed together in one change, and this issue closes when that change reaches the release branch.

  2. swapnilpaliwal-sd commented on Sep 29, 2026

    @swapnilpaliwal-sd
    ContributorAuthor

    Fixed by #1781 (merged into 0.1.9).

  3. swapnilpaliwal-sd commented on Sep 29, 2026

    @swapnilpaliwal-sd
    ContributorAuthor

    Fixed by #1781 (merged into 0.1.9).

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

Metadata

Metadata

Labels

bugSomething isn't workingengineResolution / call-graph engine rulesjavascriptJavaScript

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions