question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

eject built in xcode resulted in "SyntaxError: Use of const in strict mode."

See original GitHub issue

Description

Created app using crna cli, yarn eject using expo sdk, open xcode using ios project workspace, in xcode clean run build, resulted in JavaScript “SyntaxError: Use of const in strict mode.” with chalk module

Expected Behavior

Expected to build with xcode successfully for yarn eject code

What action did you perform, and what did you expect to happen?

creact-react-native app yarn eject, follow eject instruction and select the expo sdk one go into ios folder, pod install open ios project with xcode in xcode, run clean and build

Observed Behavior

What actually happened when you performed the above actions?

SyntaxError: Use of const in strict mode.

If there’s an error message, please paste the full terminal output and error message in this code block:

.nvm/versions/node/v7.10.1//lib/node_modules/exp/node_modules/chalk/index.js:2
const escapeStringRegexp = require('escape-string-regexp');
^^^^^
SyntaxError: Use of const in strict mode.
    at Module._compile (module.js:439:25)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)

Environment

Please run these commands in the project folder and fill in their results:

  • npm ls react-native-scripts: react-native-scripts@1.11.1
  • npm ls react-native: react-native@0.52.0
  • npm ls expo: expo@25.0.0
  • node -v: v7.10.1
  • npm -v: 4.2.0
  • yarn --version: 1.5.1
  • watchman version: 4.7.0

Also specify:

  1. Operating system: osx sierra 10.12.6
  2. Phone/emulator/simulator & version: xcode 9.2

Reproducible Demo

  1. creact-react-native app
  2. yarn eject, follow eject instruction and select the expo sdk one
  3. go into ios folder, pod install
  4. open ios project with xcode
  5. in xcode, run clean and build

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
TylerLHcommented, Jul 16, 2018

Seeing this issue as well in latest versions of CRNA & Expo/ExpoKit, even using Node 10.6.0. Node version doesn’t seem to be a factor here oddly enough.

Will continue to dig in more and report back if I’m able to find anything useful.

1reaction
brentvatnecommented, Mar 29, 2018

you can update node version as well to resolve this problem

Read more comments on GitHub >

github_iconTop Results From Across the Web

xCode Build Failed: Use of Const in Strict Mode #6951 - GitHub
Ejected Expo project (which runs fine as managed) and followed the documentation (pod update & pod install) then open the .xcworkspace file.
Read more >
SyntaxError: Use of const in strict mode - Stack Overflow
Usually this error occurs when the version of node against which the code is being executed is older than expected. (i.e. 0.12 or...
Read more >
Node.js v19.3.0 Documentation
In strict assertion mode, error messages for objects display a diff. In legacy assertion mode, error messages for objects display the objects, often...
Read more >
Safari Technology Preview Release Notes - Apple Developer
Added support for all rounding modes in Temporal (Behind the --useTemporal ... Made ElementInternals conditional on the form associated custom elements ...
Read more >
command phasescriptexecution failed with a nonzero exit ...
I tried to clean the build, remove the pod and reinstall ... expo/expoxCode Build Failed: Use of Const in Strict Mode#6951. Created almost...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found