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 loading JS bundle when running on Android #1161

Closed
haozhutw opened this issue Mar 4, 2024 · 9 comments · Fixed by #1166
Closed

Error loading JS bundle when running on Android #1161

haozhutw opened this issue Mar 4, 2024 · 9 comments · Fixed by #1166
Assignees

Comments

@haozhutw
Copy link

haozhutw commented Mar 4, 2024

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
@ahmedAlaaInstabug
Copy link
Contributor

ahmedAlaaInstabug commented Mar 4, 2024

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.

@ahmedAlaaInstabug
Copy link
Contributor

hello @haozhutw 👋, Can you please provide the node version you used ?

@haozhutw
Copy link
Author

haozhutw commented Mar 5, 2024

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.

@haozhutw
Copy link
Author

haozhutw commented Mar 5, 2024

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

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

Copy link

stale bot commented Mar 13, 2024

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
Copy link
Contributor

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 stale bot removed the Pending Feedback label Mar 13, 2024
@ahmedAlaaInstabug ahmedAlaaInstabug self-assigned this Mar 13, 2024
Copy link

stale bot commented Mar 21, 2024

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.

@gvillenave
Copy link

@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.

@leethree
Copy link
Contributor

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

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

Successfully merging a pull request may close this issue.

4 participants