question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

tsConsumer.originalPositionFor is not a function

See original GitHub issue

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.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
RishabhKarnadcommented, Aug 6, 2019

The problem occurs because of a change in source-map in which the SourceMapConsumer constructor was made asynchronous and returns a Promise. We will be releasing a fix for this soon.

1reaction
leitomcommented, Aug 5, 2019

I can confirm having these issues as well. It appears when start using <script></script> in the .vue files.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to fix 'sourceMap.map.originalPositionFor is not a function'
I have a JHipster app, when i try generate a war file by executing: mvnw -Pprod package. it produces a error in command...
Read more >
Uncaught TypeError | Is Not A Function | Solution - YouTube
Have you encountered an error like:- Uncaught TypeError- Some selector is not a function - jQuery is not a function - owlCarousel is...
Read more >
How to fix sourceMap.map.originalPositionFor is not a function
I have a JHipster app, when i try generate a anycodings_yarnpkg war file by executing: mvnw -Pprod package.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found