Skip to content

vue: a .vue file with no script file in its directory or above is not analysed #1745

Closed as duplicate

Description

@swapnilpaliwal-sd

Symptom: a .vue component is not analysed at all when no .js/.ts file sits in its directory or any parent directory, e.g. src/components/Price.vue next to src/lib/format.js, or a Nuxt pages/index.vue next to utils/helper.js. The same file is analysed once any script file is added at src/ or the root.

Repro

package.json
utils/helper.js:   export function jsHelper(n) { return n + 1; }
pages/index.vue:
  <script setup>
  import { jsHelper } from '../utils/helper.js';
  function onTap() { return jsHelper(2); }
  </script>
  <template><button @click="onTap">{{ jsHelper(1) }}</button></template>

axiomcode index, then axiomcode impact jsHelper

Expected: callers at pages/index.vue:3 and :5 (and onTap called from the template).
Actual: no callers; the graph has no declaration or call site from pages/index.vue. Adding an empty nuxt.config.js at the root makes all three appear.

Activity

  1. swapnilpaliwal-sd commented on Sep 29, 2026

    @swapnilpaliwal-sd
    ContributorAuthor

    Consolidated into #1743, which tracks this issue together with related ones about Vue single-file components: script blocks, template tags and freshness. The description and reproduction here still apply, and the fix for the group covers them.

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 rulesjavascriptJavaScripttypescriptTypeScript

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions