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

When running ns run ios, error "Cannot use import statement outside a module" occurs #1278

Open
nevardreik opened this issue Sep 16, 2020 · 0 comments

Comments

@nevardreik
Copy link

Environment
Provide version numbers for the following components (information can be retrieved by running tns info in your project folder or by inspecting the package.json of the project):

  • CLI: 7.0.8
  • Cross-platform modules: 7.03
  • iOS Runtime: 7.0.0

Describe the bug
When I run ns run ios the following error occurs (last output from log trace).

...
Executing after-prepare hook at location /Users/nevardreik/develop/mycompany/mobile/hooks/after-prepare/firebase-copy-google-services.js in-process
Validating after-prepare arguments.
Hook promises to signal completion
Hook completed
Executing after-prepare hook at location /Users/nevardreik/develop/mycompany/mobile/hooks/after-prepare/nativescript-firebase.js in-process
Validating after-prepare arguments.
Hook promises to signal completion
Hook completed
Executing after-prepare hook at location /Users/nevardreik/develop/mycompany/mobile/hooks/after-prepare/nativescript-unit-test-runner.js in-process
Failed during hook execution after-prepare.
Cannot use import statement outside a module
Error while executing action on device C21C896F-D54A-481C-9AA4-DF603F7A3431. The error is Error: Cannot use import statement outside a module
    at Errors.failWithOptions (/Users/nevardreik/.nvm/versions/node/v12.18.3/lib/node_modules/nativescript/lib/common/errors.js:157:27)
    at Errors.fail (/Users/nevardreik/.nvm/versions/node/v12.18.3/lib/node_modules/nativescript/lib/common/errors.js:130:21)
    at HooksService.<anonymous> (/Users/nevardreik/.nvm/versions/node/v12.18.3/lib/node_modules/nativescript/lib/common/services/hooks-service.js:85:30)
    at Generator.throw (<anonymous>)
    at rejected (/Users/nevardreik/.nvm/versions/node/v12.18.3/lib/node_modules/nativescript/lib/common/services/hooks-service.js:6:65)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:97:5) {
  name: 'Exception',
  errorCode: 127,
  suggestCommandHelp: false,
  proxyAuthenticationRequired: false,
  printOnStdout: undefined,
  deviceIdentifier: 'C21C896F-D54A-481C-9AA4-DF603F7A3431'
}
Multiple errors were thrown:
Cannot use import statement outside a module
Cannot use import statement outside a module
Error: Multiple errors were thrown:
Cannot use import statement outside a module
Cannot use import statement outside a module
    at Errors.failWithOptions (/Users/nevardreik/.nvm/versions/node/v12.18.3/lib/node_modules/nativescript/lib/common/errors.js:157:27)
    at Errors.fail (/Users/nevardreik/.nvm/versions/node/v12.18.3/lib/node_modules/nativescript/lib/common/errors.js:130:21)
    at DevicesService.<anonymous> (/Users/nevardreik/.nvm/versions/node/v12.18.3/lib/node_modules/nativescript/lib/common/mobile/mobile-core/devices-service.js:425:30)
    at Generator.throw (<anonymous>)
    at rejected (/Users/nevardreik/.nvm/versions/node/v12.18.3/lib/node_modules/nativescript/lib/common/mobile/mobile-core/devices-service.js:12:65)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)

Expected behavior
I would expect the Xcode build to start after this step.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant