Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Verthon opened this issue May 14, 2024 · 2 comments

Comments

@Verthon
Copy link

Verthon commented May 14, 2024

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

@shakiba
Copy link

shakiba commented Nov 23, 2024

I also see a similar error and the build produce an empty sourcemap file.

[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

@herberttn
Copy link
Owner

@Verthon @shakiba can either of you create a reproducible example? The projects I have here do not generate this error. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants