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

Failed to build with "SyntaxError: Unexpected token =" #33157

Closed
weinixuehao opened this issue Feb 21, 2022 · 3 comments
Closed

Failed to build with "SyntaxError: Unexpected token =" #33157

weinixuehao opened this issue Feb 21, 2022 · 3 comments
Labels
Needs: Triage 🔍 Stale There has been a lack of activity on this issue and it may be closed soon. Type: Upgrade Issue Issues reported from upgrade issue form

Comments

@weinixuehao
Copy link

New Version

"react-native": "0.67.2"

Old Version

0.61.5

Build Target(s)

./gradlew assembleRelease

Output of react-native info

info Fetching system and libraries information...
System:
OS: macOS 12.1
CPU: (8) x64 Apple M1 Pro
Memory: 28.83 MB / 16.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 16.14.0 - ~/.nvm/versions/node/v16.14.0/bin/node
Yarn: 1.22.17 - ~/.nvm/versions/node/v16.14.0/bin/yarn
npm: 8.3.1 - ~/.nvm/versions/node/v16.14.0/bin/npm
Watchman: Not Found
Managers:
CocoaPods: 1.11.2 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 21.2, iOS 15.2, macOS 12.1, tvOS 15.2, watchOS 8.3
Android SDK:
API Levels: 26, 30, 32
Build Tools: 28.0.3, 30.0.0, 30.0.2, 32.0.0
System Images: android-32 | Google APIs ARM 64 v8a
Android NDK: 21.1.6352462
IDEs:
Android Studio: 2020.3 AI-203.7717.56.2031.7935034
Xcode: 13.2.1/13C100 - /usr/bin/xcodebuild
Languages:
Java: 1.8.0_292 - /usr/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: 17.0.2 => 17.0.2
react-native: 0.67.2 => 0.67.2
react-native-macos: Not Found
npmGlobalPackages:
react-native: Not Found

Issue and Reproduction Steps

./gradlew assembleRelease

Task :app:bundleReleaseJsAndAssets FAILED
/Users/chenlong/workspace/AwesomeProject/node_modules/metro/src/Server.js:350
processRequest = (req, res, next) => {
^

SyntaxError: Unexpected token =
at Module._compile (internal/modules/cjs/loader.js:723:23)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Module.require (internal/modules/cjs/loader.js:692:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object. (/Users/chenlong/workspace/AwesomeProject/node_modules/metro/src/shared/output/bundle.js:12:16)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':app:bundleReleaseJsAndAssets'.

Process 'command 'node'' finished with non-zero exit value 1

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

BUILD FAILED in 5s

@weinixuehao weinixuehao added Needs: Triage 🔍 Type: Upgrade Issue Issues reported from upgrade issue form labels Feb 21, 2022
@ToshKoevoets
Copy link

Make sure you build with a node version is 14 or newer. Use nvm and set the default node version correctly, otherwise in build it might default to original older version.

@github-actions
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 Oct 17, 2022
@github-actions
Copy link

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

@facebook facebook locked as resolved and limited conversation to collaborators Oct 24, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Needs: Triage 🔍 Stale There has been a lack of activity on this issue and it may be closed soon. Type: Upgrade Issue Issues reported from upgrade issue form
Projects
None yet
Development

No branches or pull requests

2 participants