question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Build problem on Hello World

See original GitHub issue

I’ve tried following the description in the readme to generate and build a simple project. I end up with compile errors as shown in the end of this issue.

I’m using AutoRest version 2.0.4262 and node version 8.11.2.

Then generating the client:

autorest --typescript --output-folder=lib --input-file=http://petstore.swagger.io/v2/swagger.json --package-name=test --package-version=1.0.0 --add-credentials=true --generate-metadata=true

Client is successfully generated in the lib folder.

npm install
npm install -g gulp

Success!

npm run build

Results in the following errors:

> test@1.0.0 build C:\projects\autorest-javascript-example
> npm -s run-script tsc && webpack && node node_modules/uglify-es/bin/uglifyjs --source-map -c -m -o swaggerPetstoreBundle.min.js swaggerPetstoreBundle.js

lib/swaggerPetstore.ts:95:5 - error TS2322: Type '{}' is not assignable to type 'HttpHeaders'.
  Property '_headersMap' is missing in type '{}'.

95     httpRequest.headers = {};
       ~~~~~~~~~~~~~~~~~~~


lib/swaggerPetstore.ts:97:5 - error TS7017: Element implicitly has an 'any' type because type 'HttpHeaders' has no index signature.

97     httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8';
       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


lib/swaggerPetstore.ts:101:11 - error TS7017: Element implicitly has an 'any' type because type 'HttpHeaders' has no index signature.

101           httpRequest.headers[headerName] = options.customHeaders[headerName];
              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

...

npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! test@1.0.0 build: `npm -s run-script tsc && webpack && node node_modules/uglify-es/bin/uglifyjs --source-map -c -m -o swaggerPetstoreBundle.min.js swaggerPetstoreBundle.js`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the test@1.0.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\thoma\AppData\Roaming\npm-cache\_logs\2018-06-04T19_00_54_025Z-debug.log

What could be wrong here?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:13 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
ghostcommented, Jun 4, 2018

If you’re satisfied, then I’ll go ahead and close this issue.

1reaction
ghostcommented, Jun 4, 2018

I just updated my prior comment with those issues, but here they are again: Enum - https://github.com/Azure/autorest.typescript/issues/88 msRest.isStream() - https://github.com/Azure/autorest.typescript/issues/145

Read more comments on GitHub >

github_iconTop Results From Across the Web

Basic hello world created by VS does not build
1) Open Visual Studio 2017 Preview · 2) Click "File->New->Project..." · 3) Select "Other Languages->Visual C++" · 4) Select "Windows Console Application" ·...
Read more >
Eclipse - C++ hello world project's error - Stack Overflow
You have to "Build" your project before you can "Run" it. When using Eclipse for Java, you simply click the "Run" icon, then...
Read more >
Go - Hello world, linting and build problems - hectormartinez.dev
Go - Hello world, linting and build problems ... Go is a programming language that is compiled, statically typed, expressive, concise and clean....
Read more >
A modern 'Hello, World' program needs more than just code
A realistic project now requires not just an editor and a compiler, but an understanding of how programs are packaged, how the build...
Read more >
Problem compiling the Hello World recipe example
I get the following error when executing bitbake: bitbake hello-world Parsing ... NOTE: Resolving any missing task queue dependencies Build Configuration: ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found