Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when running in debug mode #4

Open
vuphuctho opened this issue May 10, 2018 · 3 comments
Open

Error when running in debug mode #4

vuphuctho opened this issue May 10, 2018 · 3 comments

Comments

@vuphuctho
Copy link

vuphuctho commented May 10, 2018

Project dependencies

  • react-native 0.51.0
  • react-native-obfuscating-transformer ^1.0.0-rc.0

Problem details

  • Add two files with info shown in Usage
  • run react-native run-ios to start app in debug mode

Observation
Following error was thrown in console:

Bundling `index.js`  [development, non-minified]  0.0% (0/952), failed.
error: bundling failed: Error: original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.
    at SourceMapGenerator_validateMapping [as _validateMapping] (/Users/{my_account}/Documents/{my_project}/node_modules/react-native-obfuscating-transformer/node_modules/source-map/lib/source-map-generator.js:276:15)
    at SourceMapGenerator_addMapping [as addMapping] (/Users/{my_account}/Documents/{my_project}/node_modules/react-native-obfuscating-transformer/node_modules/source-map/lib/source-map-generator.js:110:12)
    at /Users/{my_account}/Documents/{my_project}/node_modules/react-native-obfuscating-transformer/dist/composeSourceMaps.js:9:19
    at Array.forEach (<anonymous>)
    at Object.convertMetroRawSourceMapToStandardSourceMap (/Users/{my_account}/Documents/{my_project}/node_modules/react-native-obfuscating-transformer/dist/composeSourceMaps.js:7:9)
    at Object.obfuscateCodePreservingSourceMap (/Users/{my_account}/Documents/{my_project}/node_modules/react-native-obfuscating-transformer/dist/obfuscateCode.js:17:35)
    at Object.transform (/Users/{my_account}/Documents/{my_project}/node_modules/react-native-obfuscating-transformer/dist/obfuscatingTransformer.js:72:96)
    at asyncify (/Users/{my_account}/Documents/{my_project}/node_modules/metro-bundler/src/JSTransformer/worker/index.js:114:35)
    at /Users/{my_account}/Documents/{my_project}/node_modules/async/asyncify.js:82:27
@vuphuctho
Copy link
Author

My temporary fix is to put a check in rn-cli.config.js. This works, but I expect an official fix for this.

if (process.env.NODE_ENV === 'production') {
  module.exports = {
    getTransformModulePath() {
      return require.resolve("./transformer")
    },
  }
}

@ds300
Copy link
Contributor

ds300 commented May 10, 2018

Hi ❤️ 👋

Which version of source-map do you have? run this command and paste the output here:

cat node_modules/source-map/package.json | grep version

@vuphuctho
Copy link
Author

  "version": "0.5.7"

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

No branches or pull requests

2 participants