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

Got JS Exception: Unexpected keyword 'const'. Const declarations are not supported in strict mode. #23223

Closed
GospelHW opened this issue Jan 31, 2019 · 22 comments
Labels
Bug Resolution: Locked This issue was locked by the bot.

Comments

@GospelHW
Copy link

GospelHW commented Jan 31, 2019

I want to upgrade RN to 0.57.0 from 0.38
my step is:
1.npm install --save [email protected]
2.react-native run-android

Environment

React Native Environment Info:
System:
OS: macOS High Sierra 10.13.4
CPU: (8) x64 Intel(R) Core(TM) i7-4750HQ CPU @ 2.00GHz
Memory: 40.00 MB / 8.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 11.6.0 - /usr/local/bin/node
npm: 6.7.0 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
Android SDK:
API Levels: 22, 23, 24, 25, 26, 27, 28
Build Tools: 23.0.1, 23.0.3, 27.0.3, 28.0.3
System Images: android-28 | Google APIs Intel x86 Atom
IDEs:
Xcode: /undefined - /usr/bin/xcodebuild
npmPackages:
react: ^16.5.2 => 16.7.0
react-native: ^0.57.0 => 0.57.0
npmGlobalPackages:
react-native-cli: 2.0.1

Description

2019-01-31 10 34 31

and Devices show
device-2019-01-31-104119

Do you know what is exception?Please help me.thank you.

Reproducible Demo

@react-native-bot
Copy link
Collaborator

Can you run react-native info and edit your issue to include these results under the Environment section?

If you believe this information is irrelevant to the reported issue, you may write [skip envinfo] under Environment to let us know.

@GospelHW
Copy link
Author

@react-native-bot below is Env info:
React Native Environment Info:
System:
OS: macOS High Sierra 10.13.4
CPU: (8) x64 Intel(R) Core(TM) i7-4750HQ CPU @ 2.00GHz
Memory: 40.00 MB / 8.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 11.6.0 - /usr/local/bin/node
npm: 6.7.0 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
Android SDK:
API Levels: 22, 23, 24, 25, 26, 27, 28
Build Tools: 23.0.1, 23.0.3, 27.0.3, 28.0.3
System Images: android-28 | Google APIs Intel x86 Atom
IDEs:
Xcode: /undefined - /usr/bin/xcodebuild
npmPackages:
react: ^16.5.2 => 16.7.0
react-native: ^0.57.0 => 0.57.0
npmGlobalPackages:
react-native-cli: 2.0.1

@react-native-bot
Copy link
Collaborator

It looks like you are using an older version of React Native. Please update to the latest release, v0.58 and verify if the issue still exists.

The "Resolution: Old Version" label will be removed automatically once you edit your original post with the results of running react-native info on a project using the latest release.

@GospelHW GospelHW reopened this Feb 1, 2019
@GospelHW
Copy link
Author

GospelHW commented Feb 1, 2019

I was upgrade last version is v0.58.3, but this problem show agin now ...
Please help me
end stack is
2019-02-01 3 30 54
devices show is
device-2019-02-01-144247

@GospelHW
Copy link
Author

GospelHW commented Feb 1, 2019

@react-native-bot Are you there ?

@GospelHW
Copy link
Author

GospelHW commented Feb 1, 2019

React Native Environment Info:
System:
OS: macOS High Sierra 10.13.4
CPU: (8) x64 Intel(R) Core(TM) i7-4750HQ CPU @ 2.00GHz
Memory: 261.44 MB / 8.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 11.6.0 - /usr/local/bin/node
npm: 6.7.0 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
Android SDK:
API Levels: 22, 23, 24, 25, 26, 27, 28
Build Tools: 23.0.1, 23.0.3, 27.0.3, 28.0.3
System Images: android-28 | Google APIs Intel x86 Atom
IDEs:
Xcode: /undefined - /usr/bin/xcodebuild
npmPackages:
react: ^16.6.3 => 16.7.0
react-native: ^0.58.3 => 0.58.3
npmGlobalPackages:
react-native-cli: 2.0.1

@dulmandakh
Copy link
Contributor

please install and use react-native-git-upgrade tool. just installing new react-native from NPM is not enough because usually it requires changes in Android and XCode projects.

@dulmandakh
Copy link
Contributor

Also please make sure that RN modules are compatible with the latest version, and you're not using deprecated/remove feature.

@anarpafran
Copy link

i have this error, please help

@GospelHW
Copy link
Author

GospelHW commented Feb 2, 2019

@dulmandakh Okay ,I will try to do it.see you late

@anarpafran
Copy link

Return at the version 57. This funtioned for me

@dulmandakh dulmandakh reopened this Feb 2, 2019
@dulmandakh
Copy link
Contributor

quick search reveal that it's related to babel config. could you please check if removing .babelrc helps, and make sure that you have backup.

@only1chi
Copy link

Hi, I'm having the same issue, using RN 0.58.4. Don't know how to resolve this. Any ideas?

@agustin107
Copy link

I'm having the same issue now :/

@agustin107
Copy link

React Native Environment Info:
    System:
      OS: Linux 4.4 elementary OS 0.4.1 Loki
      CPU: (4) x64 Intel(R) Core(TM) i5-3230M CPU @ 2.60GHz
      Memory: 619.17 MB / 7.67 GB
      Shell: 5.1.1 - /usr/bin/zsh
    Binaries:
      Node: 8.12.0 - /usr/local/bin/node
      Yarn: 1.13.0 - ~/.yarn/bin/yarn
      npm: 6.4.1 - ~/.config/yarn/global/node_modules/.bin/npm
    SDKs:
      Android SDK:
        API Levels: 22, 23, 26, 27, 28
        Build Tools: 23.0.3, 24.0.3, 26.0.3, 27.0.3, 28.0.2, 28.0.3
        System Images: android-26 | Google Play Intel x86 Atom, android-27 | Intel x86 Atom_64, android-27 | Google APIs Intel x86 Atom, android-28 | Google APIs Intel x86 Atom
    npmPackages:
      react: 16.6.3 => 16.6.3 
      react-native: ^0.58.5 => 0.58.5 
    npmGlobalPackages:
      create-react-native-app: 1.0.0
      react-native-cli: 2.0.1`

@agustin107
Copy link

Getting back to 0.57.8 version solve this

@sdee3
Copy link

sdee3 commented Feb 24, 2019

Can confirm that this is indeed the solution (for now). Thanks @agustin107!!!

@CatapultJesse
Copy link

Can you make sure you're babel rc is correct (includes:

"presets": [
        "module:metro-react-native-babel-preset",
]

and you have followed the breaking changes updates from https://github.com/react-native-community/react-native-releases/blob/master/CHANGELOG.md#updating-to-this-version

@luvletterldl
Copy link

I'm having the same issue now

@luvletterldl
Copy link

React Native Environment Info:
System:
OS: macOS 10.14.3
CPU: (4) x64 Intel(R) Core(TM) i5-5350U CPU @ 1.80GHz
Memory: 31.39 MB / 8.00 GB
Shell: 5.3 - /bin/zsh
Binaries:
Node: 11.5.0 - /usr/local/bin/node
Yarn: 1.10.1 - /usr/local/bin/yarn
npm: 6.8.0 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 12.1, macOS 10.14, tvOS 12.1, watchOS 5.1
Android SDK:
API Levels: 21, 23, 26, 27, 28
Build Tools: 21.1.2, 22.0.1, 23.0.2, 27.0.3, 28.0.2, 28.0.3
IDEs:
Xcode: 10.1/10B61 - /usr/bin/xcodebuild
npmPackages:
react: 16.6.3 => 16.6.3
react-native: 0.58.6 => 0.58.6
npmGlobalPackages:
react-native-cli: 2.0.1
react-native-git-upgrade: 0.2.7

@grabbou
Copy link
Contributor

grabbou commented Mar 19, 2019

Hello there 👋 this issue doesn't have a repro (which means, a react-native init-ed project with the minimal changes that leads to creating the same issue you are reporting). Unfortunately, I have no way of helping you in a meaningful way – there is no easy way for me to recreate the situation and check that the issue reported is still there when changing the code.

Because of this, we are going to close this issue - but if a repro is shared, we are happy to reopen it 🤗

@SlowDony
Copy link

React Native Environment Info:
System:
OS: macOS 10.14
CPU: (4) x64 Intel(R) Core(TM) i5-7360U CPU @ 2.30GHz
Memory: 107.77 MB / 8.00 GB
Shell: 5.3 - /bin/zsh
Binaries:
Node: 11.14.0 - /usr/local/bin/node
Yarn: 1.16.0 - /usr/local/bin/yarn
npm: 6.9.0 - /usr/local/bin/npm
SDKs:
iOS SDK:
Platforms: iOS 12.1, macOS 10.14, tvOS 12.1, watchOS 5.1
Android SDK:
API Levels: 24, 26
Build Tools: 26.0.1
System Images: a...s_playstore | Google Play Intel x86 Atom Sys...
IDEs:
Android Studio: 2.3 AI-162.4069837
Xcode: 10.1/10B61 - /usr/bin/xcodebuild
npmPackages:
react: 16.8.3 => 16.8.3
react-native: 0.59.8 => 0.59.8
npmGlobalPackages:
react-native-cli: 2.0.1

@facebook facebook locked as resolved and limited conversation to collaborators Mar 19, 2020
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Mar 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests