Skip to content

Source map error using <style module> without a <template> #123

Closed
@chrisvfritz

Description

@chrisvfritz

Starting v3.0.0, I'm seeing this error:

SyntaxError: Unexpected token m in JSON at position 0
        at JSON.parse (<anonymous>)

      at Object.parseSourceMapInput (node_modules/source-map-support/node_modules/source-map/lib/util.js:433:15)
      at new SourceMapConsumer (node_modules/source-map-support/node_modules/source-map/lib/source-map-consumer.js:17:22)
      at mapSourcePosition (node_modules/source-map-support/source-map-support.js:190:14)
      at wrapCallSite (node_modules/source-map-support/source-map-support.js:358:20)
      at node_modules/source-map-support/source-map-support.js:395:26
          at Array.map (<anonymous>)
      at Function.prepareStackTrace (node_modules/source-map-support/source-map-support.js:394:24)
          at Generator.throw (<anonymous>)

when trying to import a .vue file like below into a Jest test:

<script>
export default {
  render: h => h('div')
}
</script>

<style module>
.foo {
  color: orange;
}
</style>

The error even occurs with just:

<style module>
</style>

It goes away as soon as I add a <template> tag, e.g.:

<template/>

<style module>
</style>

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions