Instabug/Instabug-React-Native

Error loading JS bundle when running on Android

haozhutw opened this issue ยท 9 comments

A build error is introduced since 12.7.0, please see screenshot below.

Screenshot_1709550396

Did you test the library before you publish the new version?

SDK Version

"instabug-reactnative": "12.7.0",

Device Model

Android simulator

[Optional] Project That Reproduces the Issue

just upgrade instabug-reactnative to 12.7.0, build on Android simulator successfully and then failed to load the js bundle because of this error

error node_modules/instabug-reactnative/src/modules/Instabug.ts: Unexpected token: operator (?) in file node_modules/instabug-reactnative/src/modules/Instabug.ts at 52:36. Run CLI with --verbose flag for more details.

This is the screenshot of the code in instabug-reactnative

Screenshot 2024-03-04 at 19 09 42

Hello @haozhutw ๐Ÿ‘‹ , Thanks for reporting this issue, I'll check this out and will get back to you with more info as soon as possible.

hello @haozhutw ๐Ÿ‘‹, Can you please provide the node version you used ?

hello @haozhutw ๐Ÿ‘‹, Can you please provide the node version you used ?

node version: v18.19

I downgrade the instabug-reactnative to v12.6.0, no error occurs.

Maybe ??= is too advanced for some old environment, can you make it compatible like this?

if (!config.networkInterceptionMode) {
    config.networkInterceptionMode = NetworkInterceptionMode.javascript;
}
stale commented

This issue has been automatically marked as pending feedback because we need additional information to be able to investigate it further. It will be closed in 7 days if it remains inactive. Thank you for your contributions.

hello @haozhutw can you please try this version and let us know if it fixes your issue?

Installation

You can install the snapshot through NPM:

npm install https://github.com/Instabug/Instabug-React-Native\#snapshot/fix-init-function-error-on-old-node-version

or Yarn:

yarn add https://github.com/Instabug/Instabug-React-Native\#snapshot/fix-init-function-error-on-old-node-version
stale commented

This issue has been automatically marked as pending feedback because we need additional information to be able to investigate it further. It will be closed in 7 days if it remains inactive. Thank you for your contributions.

@ahmedAlaaInstabug I see that the PR with the fix was merged, but it doesn't seem that a new version was released with that fix? Can this be prioritized?
FWIW, it's not due to using an old version of TypeScript, this reproduces on 5.4.3. I've found other reports indicating that the nullish coalescing operator might not be currently supported by the React Native bundler.

We are seeing this issue. It's not supported syntax in React Native. It has nothing to do with Typescript version or Node version.