Skip to content
This repository has been archived by the owner on Feb 17, 2023. It is now read-only.

Error: "Sourcemap is likely to be incorrect" usiing rolloutOptions.output.sourcemap = true #34

Closed
nabebin opened this issue Feb 8, 2021 · 7 comments

Comments

@nabebin
Copy link

nabebin commented Feb 8, 2021

I try to generate bundle files together with sourcemaps by running vite build and receive these errors:

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

vite.config.ts

import { defineConfig } from 'vite'
import { createVuePlugin } from 'vite-plugin-vue2'
import { resolve } from 'path'

export default defineConfig({
  plugins: [createVuePlugin()],
  alias: {
    '/@': resolve(__dirname, './src'),
  },
  build: {
    lib: {
      entry: resolve(__dirname, './src/index.ts'),
      name: 'ComponentLibrary'
    },
    rollupOptions: {
      output: {
        sourcemap: true,
      }
    }
  }
})

Dependencies and system data

vite: 2.0.0-beta.65
vite-plugin-vue2: 1.2.0
vue: 2.6.12
Node.js: v14.15.4

I think this issue might be related to the one I've described: vitejs/vite#1677

@tjk
Copy link
Contributor

tjk commented Feb 22, 2021

FYI It looks like sourcemaps are part of the TODO section at the bottom of the README.

(PS: I do see this as well when enabling build.sourcemap)

@underfin underfin reopened this Mar 19, 2021
@greegus
Copy link

greegus commented May 22, 2021

@underfin is there any roadmap for implementing the source maps support yet? Right now this is the only deal-breaker of Vite migration on multiple of our projects.

@underfin
Copy link
Owner

Sorry for later feedback. I'm a little busy for work. I will take a look at this week.

@qnp
Copy link
Contributor

qnp commented May 28, 2021

Here is an attempt to implement source maps to fix the warnings : #84
As @underfin is quite busy, anyone else who can also take a look is welcome.

@underfin
Copy link
Owner

Fixed at #84

@khalwat
Copy link

khalwat commented Jan 12, 2022

I'm still seeing this in my Vite projects that use your excellent vite-plugin-vue2 (thank you!):

rendering chunks (21)...Sourcemap is likely to be incorrect: a plugin (vite:define) was used to transform files, but didn't generate a sourcemap for the transformation. Consult the plugin documentation for help
Sourcemap is likely to be incorrect: a plugin (vite:define) was used to transform files, but didn't generate a sourcemap for the transformation. Consult the plugin documentation for help
  "devDependencies": {
    "@rollup/plugin-node-resolve": "^13.0.0",
    "@typescript-eslint/eslint-plugin": "^5.0.0",
    "@typescript-eslint/parser": "^5.0.0",
    "autoprefixer": "^10.4.0",
    "eslint": "^8.0.0",
    "eslint-plugin-vue": "^8.0.0",
    "postcss": "^8.0.0",
    "rollup-plugin-visualizer": "^5.0.0",
    "stylelint": "^14.0.0",
    "stylelint-config-recommended": "^6.0.0",
    "stylelint-config-standard-scss": "^3.0.0",
    "stylelint-config-recommended-vue": "^1.0.0",
    "tailwindcss": "^3.0.0",
    "vite": "^2.7.0",
    "vite-plugin-eslint": "^1.3.0",
    "vite-plugin-compression": "^0.4.0",
    "vite-plugin-externals": "^0.3.2",
    "vite-plugin-restart": "0.0.2",
    "vite-plugin-stylelint": "^1.1.0",
    "vite-plugin-vue2": "^1.9.0"
  },

@bjp232004
Copy link

I am also facing the issue:
rendering chunks (1)...Sourcemap is likely to be incorrect: a plugin (vite:build-import-analysis) was used to transform files, but didn't generate a sourcemap for the transformation. Consult the plugin documentation for help

Below is the source map file content:
{"version":3,"file":"index.7aacfb63.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}

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

No branches or pull requests

7 participants