Skip to content

tsConsumer.originalPositionFor is not a function #179

Closed
@RohanTalip

Description

@RohanTalip

Hi,

I recently upgraded both Vue Native and React Native recently from these versions:

    "react-native": "0.60.0",
    "vue-native-core": "0.0.8",
    "vue-native-helper": "0.0.11",
    "vue-native-scripts": "0.0.16"

... to these versions:

    "react-native": "0.60.4",
    "vue-native-core": "0.1.0",
    "vue-native-helper": "0.1.0",
    "vue-native-scripts": "0.1.0"

I have both Live Reload and Hot Reloading enabled in the React Native developer menu.

When I edit a .vue file, I get this error in the terminal window that the Metro Bundler is running in:

error: bundling failed: TypeError: tsConsumer.originalPositionFor is not a function
    at $PATH_TO_MY_VUE_NATIVE_APP/node_modules/vue-native-scripts/build.js:511:38
    at Object.traverseFast ($PATH_TO_MY_VUE_NATIVE_APP/node_modules/babel-types/lib/index.js:744:3)
    at Function.traverse.cheap ($PATH_TO_MY_VUE_NATIVE_APP/node_modules/babel-traverse/lib/index.js:91:12)
    at sourceMapAstInPlace ($PATH_TO_MY_VUE_NATIVE_APP/node_modules/vue-native-scripts/build.js:509:14)
    at Object.transform ($PATH_TO_MY_VUE_NATIVE_APP/node_modules/vue-native-scripts/build.js:551:7)
    at Object.module.exports.transform ($PATH_TO_MY_VUE_NATIVE_APP/vueTransformerPlugin.js:30:29)
    at $PATH_TO_MY_VUE_NATIVE_APP/node_modules/metro/src/JSTransformer/worker.js:231:31
    at Generator.next (<anonymous>)
    at asyncGeneratorStep ($PATH_TO_MY_VUE_NATIVE_APP/node_modules/metro/src/JSTransformer/worker.js:75:24)

This error also shows up in the iPhone Simulator on my Mac. If I upgrade either Vue Native or React Native (but not both) to the latest versions above I don't seem to have this issue (i.e. I keep the older versions for the other set of packages).

Looking in vue-native-scripts/build.js around line 511, I see that tsConsumer is a SourceMapConsumer:

  var tsConsumer = new sourceMap.SourceMapConsumer(tsMap);

The patch release notes for React Native version 0.60.4 mention source maps!

I suspect that there's some incompatibility between React Native v0.60.4 and the latest versions of Vue Native in terms of source maps.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions