Build problem on Hello World
See original GitHub issueI’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:
- Created 5 years ago
- Comments:13 (6 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
If you’re satisfied, then I’ll go ahead and close this issue.
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