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

generate-odata-client results in Unexpected token 'export' #433

Closed
levinanton opened this issue Aug 28, 2020 · 2 comments
Closed

generate-odata-client results in Unexpected token 'export' #433

levinanton opened this issue Aug 28, 2020 · 2 comments
Labels
bug Something isn't working

Comments

@levinanton
Copy link

Describe the bug

Execution of

generate-odata-client --inputDir /in --outputDir /out

fails with ERROR uncaughtException: Unexpected token 'export'

To Reproduce

Steps to reproduce the behavior:

  1. Install npm install -g @sap-cloud-sdk/generator
  2. Execute generate-odata-client --inputDir /in --outputDir /out
  3. See error in terminal

Expected behavior

Get generated output.

Used Versions:

  • node version v13.6.0
  • npm version 6.13.4
  • "@sap-cloud-sdk/generator": "1.27.0"

Log file

[2020-08-27T12:13:16.337Z] ERROR  uncaughtException: Unexpected token 'export'

/usr/local/lib/node_modules/@sap-cloud-sdk/generator/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:1060:16)

  at Module._compile (internal/modules/cjs/loader.js:1108:27)

  at Object.Module._extensions..js (internal/modules/cjs/loader.js:1164:10)

  at Module.load (internal/modules/cjs/loader.js:993:32)

  at Function.Module._load (internal/modules/cjs/loader.js:892:14)

  at Module.require (internal/modules/cjs/loader.js:1033:19)

  at require (internal/modules/cjs/helpers.js:72:18)

  at Object.<anonymous> (/usr/local/lib/node_modules/@sap-cloud-sdk/generator/node_modules/@sap-cloud-sdk/core/dist/odata/v2/odata-batch-change-set.js:5:14)

  at Module._compile (internal/modules/cjs/loader.js:1144:30)

  at Object.Module._extensions..js (internal/modules/cjs/loader.js:1164:10)
@levinanton levinanton added the bug Something isn't working label Aug 28, 2020
@marikaner
Copy link
Contributor

Hey @levinanton,

this is due to the fact that you are using an outdated unstable version of node. Please take a look at the release schedule of node. It states that odd-numbered versions become unsupported after 6 months. In addition to that 13.6 is quite an old version - with 13.14 the generation works again. I would recommend to either downgrade to node 12 or upgrade to node 14.

I hope that helps!

@levinanton
Copy link
Author

Changing to node v13.14.0 solved the problem. Many thanks for your hint.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants