Skip to content

[求助]SoureMap无法正确追踪到代码 #562

@dubiao

Description

@dubiao

我在生成ppk时,使用了 --sourceMap 参数在项目里生成了 sourceMap,当App(iOS)崩溃时收到以下:

This error is located at:
    at   (/var/mobile/Containers/Data/Application/.../index.bundlejs:1335:966)
    at c (/var/mobile/Containers/Data/Application/.../index.bundlejs:1452:794)
    at o (/var/mobile/Containers/Data/Application/.../index.bundlejs:964:690)
    at RCTView (<anonymous>)
    at   (/var/mobile/Containers/Data/Application/.../index.bundlejs:74:1428)
    at F (/var/mobile/Containers/Data/Application/.../index.bundlejs:551:4893)
    at RCTView (<anonymous><…>  XXXX

我依次对行列号进行了sourceMap查询:

source-map resolve .pushy/intermedia/ios/index.bundlejs.map 551 4893
Maps to /path-to-app/src/apps/bizzz/App.js:249:47 

  const [isLoadingKeys, setLoading] = useState({
                                               ^
source-map resolve .pushy/intermedia/ios/index.bundlejs.map 74 1428
Maps to /path-to-app/node_modules/react-native/Libraries/Components/View/View.js:28:21 (_ref)

  ...props: ViewProps
                     ^
source-map resolve .pushy/intermedia/ios/index.bundlejs.map 964 690
Maps to /path-to-app/node_modules/react-redux/lib/components/Provider.js:19:2 (store)

  store,
  ^
source-map resolve .pushy/intermedia/ios/index.bundlejs.map 1452 794
Maps to /path-to-app/node_modules/@react-navigation/native/lib/module/NavigationContainer.js:18:2 (direction)

  direction = I18nManager.getConstants().isRTL ? 'rtl' : 'ltr',
  ^
source-map resolve .pushy/intermedia/ios/index.bundlejs.map 1335 966
Maps to /path-to-app/node_modules/@react-navigation/core/lib/module/BaseNavigationContainer.js:72:2 (initialState)

  initialState,
  ^

以上所示,

  1. 不仅与我的崩溃不在一个业务线上

  2. 而且本身所指也都是变量的使用或甚至在标识的中间

  3. 我也上下查看过相关代码,均没有找到可能崩溃的点。

也可能是我的用法不正确,所以想问一下,如何反查这个bug的位置?

是否与app下载是diff文件,apply到js以后有变化?不过以我的理解,apply diff 以后应该也是与我上传的bundle变成一样的了吧?

总之,求教大家,如果通过sourceMap来查崩溃点。

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions