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

Unexpected token import, v0.56.0-rc cliEntry.js error #19669

Closed
yakirbu opened this issue Jun 12, 2018 · 10 comments
Closed

Unexpected token import, v0.56.0-rc cliEntry.js error #19669

yakirbu opened this issue Jun 12, 2018 · 10 comments
Labels
Platform: Android Android applications. Ran Commands One of our bots successfully processed a command. Resolution: Locked This issue was locked by the bot.

Comments

@yakirbu
Copy link

yakirbu commented Jun 12, 2018

Using the latest RN pr v0.56.0-rc
When running 'react-native run-android', I get an error saying it doesn't recognize the import command in clipEntry.js, line 30.

...\node_modules\react-native\local-cli\cliEntry.js:30
import type { CommandT } from './commands';
^^^^^^

SyntaxError: Unexpected token import
    at createScript (vm.js:80:10)
    at Object.runInThisContext (vm.js:139:10)
    at Module._compile (module.js:616:28)
    at Module._compile (Y:\React-Native\trivia-mobile-n\node_modules\pirates\lib\index.js:91:24)
    at Module._extensions..js (module.js:663:10)
    at Object.newLoader [as .js] (Y:\React-Native\trivia-mobile-n\node_modules\pirates\lib\index.js:96:7)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
    at Module.require (module.js:596:17)

my devDependencies -

"devDependencies": {
    "@babel/core": "^7.0.0-beta.49",
    "babel-core": "^7.0.0-bridge.0",
    "babel-jest": "^23.0.1",
    "babel-preset-react-native": "^5.0.0",
    "babel-preset-react-native-stage-0": "^1.0.1",
    "fs-extra": "^4.0.2",
    "jest": "22.0.6",
    "react-test-renderer": "16.2.0",
    "replace-in-file": "^3.0.0"
  },
@yakirbu yakirbu changed the title Running v0.56.0-rc cliEntry.js error Unexpected token import, v0.56.0-rc cliEntry.js error Jun 12, 2018
@johakr
Copy link

johakr commented Jun 12, 2018

Imho, this happens because #19666 After further investigation, I think these are two seperate issues.

@react-native-bot
Copy link
Collaborator

We are automatically closing this issue because it does not appear to follow any of the provided issue templates.

Please make use of the bug report template to let us know about a reproducible bug or regression in the core React Native library.

If you'd like to start a discussion, check out https://discuss.reactjs.org or follow the discussion template.

@react-native-bot react-native-bot added Ran Commands One of our bots successfully processed a command. 📋No Template labels Jun 15, 2018
@yakirbu
Copy link
Author

yakirbu commented Jun 15, 2018

I don't think a template would be relevant here, since this is a general error that occurs with a simple cli 'run-android' command.

@johakr
Copy link

johakr commented Jun 15, 2018

This seems to be an issue with how babel 7 resolves paths on windows. There is some path seperator replacement in https://github.com/facebook/metro/blob/master/packages/metro-babel-register/src/babel-register.js. If you remove both occurences of .replace(/\\/g, '/') the cliEntry error is gone. However, there seems to be an issue with haste module resolving on windows then.

Might be a react-native issue, might be a metro issue or might be a babel issue. Anyways, v0.56.0-rc is broken on windows.

@rozele
Copy link
Contributor

rozele commented Jun 15, 2018

@hramos Please re-open this issue. Although the template is not provided, this is a major blocking issue for any react-native development on Windows, including react-native-windows apps.

@Dimous
Copy link

Dimous commented Jun 19, 2018

Hey @yakirbu, what if you fill in the template, would the bot be pleased? Just to fool it.

@hramos
Copy link
Contributor

hramos commented Jun 19, 2018

@rozele can you submit a new issue in that case? I see no reason why the template cannot be used here.

@johakr
Copy link

johakr commented Jun 20, 2018

I think there is already some initiative to fix this issue here:

@hramos
Copy link
Contributor

hramos commented Jun 20, 2018

Duplicate of #19654

@hramos hramos marked this as a duplicate of #19654 Jun 20, 2018
@facebook facebook locked as spam and limited conversation to collaborators Jul 5, 2018
@kelset
Copy link
Contributor

kelset commented Jul 5, 2018

(locking to prevent spam leaking from #20015)

@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jun 15, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Platform: Android Android applications. Ran Commands One of our bots successfully processed a command. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

7 participants