Skip to content

Sourcemap is likely to be incorrect: a plugin (vite-plugin-typescript-transform) was used to transform files, but didn't generate a sourcemap for the transformationΒ #4

@Verthon

Description

@Verthon

Hi, we are using following setup in vite-config to generate source-maps:

plugins: [
tsconfigPaths(),
    vitePluginTypescriptTransform({
      enforce: 'pre',
      filter: {
        files: {
          include: /\.ts$/,
        },
      },
    }),
]
build: {
    outDir: 'dist',
    minify: false,
    sourcemap: true,
    rollupOptions: {
      preserveEntrySignatures: 'strict',
      input: {
        index: 'src/index.ts',
      },
      output: [
        {
          dir: 'dist/esm',
          format: 'esm',
          preserveModules: true,
          preserveModulesRoot: 'src',
          entryFileNames: ({ name: fileName }) => `${fileName}.js`,
        },
        {
          dir: 'dist/cjs',
          format: 'cjs',
          entryFileNames: ({ name: fileName }) => `${fileName}.cjs`,
        },
      ],
      external: (id) => peerDeps.includes(id),
    },
  },

When using build command we run into warning inside of the terminal:

[plugin vite-plugin-typescript-transform] Sourcemap is likely to be incorrect: a plugin (vite-plugin-typescript-transform) was used to transform files, but didn't generate a sourcemap for the transformation. Consult the plugin documentation for help

Versions that we use on Node 18:

{
"typescript": "5.4.5",
"vite-plugin-typescript-transform": "1.3.0",
"vite-tsconfig-paths": "4.3.2",
"vite": "5.2.11",
}

Please let me know if you need a minimal reproducible example. Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions