Skip to content

javascript: imports through a SvelteKit or Nuxt alias never resolve when the config only extends the framework's generated tsconfig #1756

Closed

Description

@swapnilpaliwal-sd

Symptom. In a SvelteKit or Nuxt app written in JavaScript, imports through the framework's own alias ($lib/api, ~/utils/price) never resolve, so every call through them is [by name]. The project's jsconfig.json/tsconfig.json only extends a config the framework generates at dev/build time (./.svelte-kit/tsconfig.json, ./.nuxt/tsconfig.json), which is absent from a checkout, so no paths are ever read.

Repro.

tsconfig.json            {"extends":"./.nuxt/tsconfig.json"}
utils/price.js           export function formatPrice(n) { return n; }
server/api/price.js      import { formatPrice } from '~/utils/price';
                         export default function handler() { return formatPrice(1); }

axiomcode impact formatPrice → server/api/price.js:2 … [by name]. Same on a real SvelteKit app: import * as api from '$lib/api.js' in 10+ route files, every api.get/post by name.

Expected: handler → formatPrice resolved (the framework's default mapping: SvelteKit $lib/* → src/lib/*; Nuxt ~/*, @/* → the source dir) when the extended config does not exist.
Actual: unresolved, [by name].

Activity

  1. swapnilpaliwal-sd commented on Sep 29, 2026

    @swapnilpaliwal-sd
    ContributorAuthor

    Consolidated into #1746, which tracks this issue together with related ones about JavaScript import aliases from bundler and framework configs. The description and reproduction here still apply, and the fix for the group covers them.

  2. swapnilpaliwal-sd commented on Sep 29, 2026

    @swapnilpaliwal-sd
    ContributorAuthor

    Fixed by #1773 (merged into 0.1.8).

  3. added a commit that references this issue on Oct 11, 2026
    11d2ba4
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