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

Updating cli from 6.9.3 → 6.10.1 SyntaxError: Unexpected token 'export' #4499

Closed
thenaim opened this issue Jul 26, 2020 · 4 comments · Fixed by #4501
Closed

Updating cli from 6.9.3 → 6.10.1 SyntaxError: Unexpected token 'export' #4499

thenaim opened this issue Jul 26, 2020 · 4 comments · Fixed by #4501
Labels

Comments

@thenaim
Copy link

thenaim commented Jul 26, 2020

Description:
After update getting error

Steps to Reproduce:

  1. install latest version ionic cli
npm i -g @ionic/cli@latest
  1. check version or serve your project
ionic -v

Output:

bossjon@boss:~$ ionic -v
6.10.1
/usr/local/lib/node_modules/@ionic/cli/node_modules/uuid/dist/esm-browser/index.js:1

export { default as v1 } from './v1.js';
^^^^^^

SyntaxError: Unexpected token 'export'
at wrapSafe (internal/modules/cjs/loader.js:1053:16)
at Module._compile (internal/modules/cjs/loader.js:1101:27)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
at Module.load (internal/modules/cjs/loader.js:985:32)
at Function.Module._load (internal/modules/cjs/loader.js:878:14)
at Module.require (internal/modules/cjs/loader.js:1025:19)
at require (internal/modules/cjs/helpers.js:72:18)
at Object.<anonymous> (/usr/local/lib/node_modules/@ionic/cli/lib/utils/uuid.js:3:16)
at Module._compile (internal/modules/cjs/loader.js:1137:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)

My ionic info:

bossjon@boss:~$ ionic info
/usr/local/lib/node_modules/@ionic/cli/node_modules/uuid/dist/esm-browser/index.js:1

export { default as v1 } from './v1.js';
^^^^^^

SyntaxError: Unexpected token 'export'
at wrapSafe (internal/modules/cjs/loader.js:1053:16)
at Module._compile (internal/modules/cjs/loader.js:1101:27)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
at Module.load (internal/modules/cjs/loader.js:985:32)
at Function.Module._load (internal/modules/cjs/loader.js:878:14)
at Module.require (internal/modules/cjs/loader.js:1025:19)
at require (internal/modules/cjs/helpers.js:72:18)
at Object.<anonymous> (/usr/local/lib/node_modules/@ionic/cli/lib/utils/uuid.js:3:16)
at Module._compile (internal/modules/cjs/loader.js:1137:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
[WARN] You are not in an Ionic project directory. Project context may be missing.

Ionic:

   Ionic CLI : 6.10.1

Utility:

   cordova-res : not installed
   native-run  : not installed

System:

   NodeJS : v12.18.3
   npm    : 6.14.6
   OS     : Linux 5.4

Ps: Other versions works fine.

@ionitron-bot ionitron-bot bot added the triage label Jul 26, 2020
@sadelbrid
Copy link

sadelbrid commented Jul 26, 2020

Same issue here. I uninstalled the old CLI by running these commands

npm uninstall -g ionic
npm install -g @ionic/cli

Now I get this error when I run anything ionic-related it seems. I also just tried to create a template project to compare to my current project to see what the difference might be, but I'm having no luck - the template creation goes in circles. I ran

ionic start myApp tabs

This shows the error but then steps me through the project creation with no problems (seemingly). Then I ran

ionic start

which just asked me what template I want to use and has me going in circles.

@imhoffd
Copy link
Contributor

imhoffd commented Jul 27, 2020

Seems related to this issue? uuidjs/uuid#488

It appears to be importing an ES6/browser version, despite using const uuid = require('uuid').

@imhoffd
Copy link
Contributor

imhoffd commented Jul 27, 2020

Anyway, our requirements for generating a UUID aren't enough to warrant continuing to use that module. I replaced it with an inline version in #4501.

@imhoffd
Copy link
Contributor

imhoffd commented Jul 27, 2020

Please try 6.10.2 with this fix.

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

Successfully merging a pull request may close this issue.

3 participants