vuejs / component-compiler-utils

Lower level utilities for compiling Vue single file components
319 stars 75 forks source link

Invalid source map generated by parse #46

Closed znck closed 5 years ago

znck commented 5 years ago

https://github.com/vuejs/component-compiler-utils/blob/8de35e69abc1d7ac9dc879237f0f2743c70b0327/lib/parse.ts#L111

{ version: 3,
  sources:
   [ '/Users/znck/Workspace/Experiments/repro-rollup-plugin-vue/src/App.vue' ],
  names: [],
  mappings:
   [ [],
     [],
     [],
     [],
     [],
     [],
     [],
     [],
     [],
     [],
     [],
     [ Int32Array [ 0, 0, 11, 0 ] ],
     [ Int32Array [ 0, 0, 12, 0 ] ],
     [ Int32Array [ 0, 0, 13, 0 ] ] ],
  file:
   '/Users/znck/Workspace/Experiments/repro-rollup-plugin-vue/src/App.vue',
  sourceRoot: '/Users/znck/Workspace/Experiments/repro-rollup-plugin-vue',
  sourcesContent:
   [ '<script>\nexport default {\n  \n}\n</script>\n\n<template>\n  <div class="foo">foo</div>\n</template>\n\n<style>\n.foo { \n  color: red;\n}\n</style>' ] }

mappings should be string.

Related: https://github.com/vuejs/rollup-plugin-vue/issues/251

znck commented 5 years ago

Fixed by adding source-map@0.7.1 as a dependency to rollup-plugin-vue.