Skip to content

Sourcemap out of sync with the actual code when testing #2332

@Bricklou

Description

@Bricklou

Please provide the environment you discovered this bug in.

VSCode: 1.118.1
Vitest extension: 1.50.3
Vitest: 4.1.5
Vite: 8.0.2
Angular: 21.2.9
Vite-plugin-Angular: 2.4.10 (also tried 2.5.0 and 2.5.1-beta.2)
NX: 22.7.0

// tsconfig.json
{
    "compilerOptions": {
        "target": "es2023",
        "lib": [
            "es2024",
            "DOM"
        ],
        "emitDecoratorMetadata": true,
        "experimentalDecorators": true,
        "rootDir": ".",
        "module": "esnext",
        "moduleResolution": "bundler",
        "strict": true,
        "noFallthroughCasesInSwitch": true,
        "noImplicitOverride": true,
        "noImplicitReturns": true,
        "noPropertyAccessFromIndexSignature": true,
        "importHelpers": true,
        "sourceMap": true,
        "forceConsistentCasingInFileNames": true,
        "skipDefaultLibCheck": true,
        "skipLibCheck": true
    },
    "references": [
        {
            "path": "./tsconfig.lib.json"
        },
        {
            "path": "./tsconfig.scripts.json"
        },
        {
            "path": "./tsconfig.spec.json"
        },
        {
            "path": "./.storybook/tsconfig.json"
        }
    ],
    "files": [],
    "include": [],
    "angularCompilerOptions": {
        "enableI18nLegacyMessageIdFormat": false,
        "strictInjectionParameters": true,
        "strictInputAccessModifiers": true,
        "strictTemplates": true
    }
}

// tsconfig.lib.json
{
    "extends": "./tsconfig.json",
    "compilerOptions": {
        "types": [],
        "declaration": true,
        "declarationMap": true,
        "inlineSources": true,
        "outDir": "../../dist/out-tsc",
        "sourceMap": true
    },
    "include": [
        "src/**/*.ts"
    ],
    "exclude": [
        "**/*.stories.ts",
        "**/*.spec.ts",
        "src/tests/**.ts"
    ]
}

// tsconfig.spec.json
{
    "extends": "./tsconfig.json",
    "compilerOptions": {
        "types": [
            "vitest",
            "vitest/browser",
            "vite/client"
        ],
        "declaration": true,
        "declarationMap": true,
        "inlineSources": true,
        "outDir": "../../dist/out-tsc",
        "sourceMap": true
    },
    "include": [
        "**/*.spec.ts",
        "src/tests/**/*.ts"
    ]
}

Which area/package is the issue in?

vite-plugin-angular

Description

Hello, i'm working on a project running Vite 8.0.2 and vite-plugin-angular 2.4.10 and when using the Vitest VSCode extension, the gutter icons and the lines while debugging are out of sync with the current code.

I saw there was an issue in the past version (1.x) #1211, but it seems the issue is here again (maybe because of the migration from esbuild to rolldown?).

Image

Please provide the exception or error you saw


Other information

No response

I would be willing to submit a PR to fix this issue

  • Yes
  • No

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions