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

Using underscore as number separator leads to error on android build #31551

Closed
karladler opened this issue May 18, 2021 · 6 comments
Closed

Using underscore as number separator leads to error on android build #31551

karladler opened this issue May 18, 2021 · 6 comments
Labels
Needs: Triage 🔍 Stale There has been a lack of activity on this issue and it may be closed soon.

Comments

@karladler
Copy link

Description

Using an underscore as number separator as described in this proposal leads to an error when building for android.

React Native version:

System:
OS: macOS 11.3
CPU: (8) x64 Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz
Memory: 557.13 MB / 16.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 12.14.0 - /var/folders/3j/s9sr4g451jnc23rbpm_jrmq40000gn/T/yarn--1621366915073-0.898045261402493/node
Yarn: 1.22.10 - /var/folders/3j/s9sr4g451jnc23rbpm_jrmq40000gn/T/yarn--1621366915073-0.898045261402493/yarn
npm: 7.11.2 - ~/.nvm/versions/node/v12.14.0/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.10.1 - /Users/karl/.gem/bin/pod
SDKs:
iOS SDK:
Platforms: iOS 14.4, DriverKit 20.2, macOS 11.1, tvOS 14.3, watchOS 7.2
Android SDK:
API Levels: 27, 28, 29
Build Tools: 28.0.2, 28.0.3, 29.0.2, 30.0.2
System Images: android-28 | Google APIs Intel x86 Atom
Android NDK: Not Found
IDEs:
Android Studio: 3.3 AI-182.5107.16.33.5314842
Xcode: 12.4/12D4e - /usr/bin/xcodebuild
Languages:
Java: 1.8.0_275 - /usr/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: 17.0.1 => 17.0.1
react-native: 0.64.0-rc.2 => 0.64.0-rc.2
react-native-macos: Not Found
npmGlobalPackages:
react-native: Not Found

Steps To Reproduce

Provide a detailed list of steps that reproduce the issue.

  1. Use any number with underscores like 10_000
  2. build the app on android
  3. results in [SyntaxError: No identifiers allowed directly after numeric literal]
  4. Building the app for ios works perfect.

Expected Results

  • App should also build on android
  • or error should at least be a bit more specific

Snack, code example, screenshot, or link to a repository:

Screenshot 2021-05-18 at 21 52 14

@ezranbayantemur
Copy link

I'm not sure about that but maybe numeral.js can help you about number formatting. It's not a solution about your issue context, of course. but maybe you can check it out if your problem is urgent.

@LinusU
Copy link
Contributor

LinusU commented Jun 27, 2022

Seems to still be a problem in react-native@0.64.3:

[17:19:54] myfile.ts: Unexpected token name «_000», expected punc «,» in file myfile.ts at 63:11
[17:19:54] Error: Unexpected token name «_000», expected punc «,» in file myfile.ts at 63:11
    at /myproject/node_modules/metro-transform-worker/src/index.js:279:15
    at Generator.next (<anonymous>)
    at asyncGeneratorStep (/myproject/node_modules/metro-transform-worker/src/index.js:146:24)
    at _next (/myproject/node_modules/metro-transform-worker/src/index.js:168:9)
    at /myproject/node_modules/metro-transform-worker/src/index.js:175:7
    at new Promise (<anonymous>)
    at /myproject/node_modules/metro-transform-worker/src/index.js:164:12
    at minifyCode (/myproject/node_modules/metro-transform-worker/src/index.js:289:17)
    at Object.<anonymous> (/myproject/node_modules/metro-transform-worker/src/index.js:569:40)

@peterferguson
Copy link

+1

1 similar comment
@jeffngugi
Copy link

+1

Copy link

This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Jan 23, 2024
Copy link

This issue was closed because it has been stalled for 7 days with no activity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs: Triage 🔍 Stale There has been a lack of activity on this issue and it may be closed soon.
Projects
None yet
Development

No branches or pull requests

5 participants