Open martinmcwhorter opened 7 years ago
could this be related to https://github.com/swagger-api/swagger-codegen/issues/6722?
@martinmcwhorter we are currently working on making the generated library AOT compiled into a dist that you can publish. Currently if you want it to work you can publish the entire uncompiled typescript generated library as my team has done here.
https://www.npmjs.com/package/@herd/angular-client
Basically we currently don't compile using NGC. the original template only used tsc which doesn't produce metadata.json
You can watch this pr https://github.com/swagger-api/swagger-codegen/pull/6735
The idea would be at the end the client supports UMD / ES2015 / ES5 all in FESM AOT pased on the Angular Library Format 4/5
Sorry for the inconvenience.
@martinmcwhorter The other alternative is just to setup the tsconfig.json / package.json / rollup yourself based on the Angular Libarary Format
Description
After generating a proxy for typescript-angular as an NPM module, I cannot provide the
BASE_PATH
without getting the following error:BASE_PATH Error encountered resolving symbol values statically. Only initialized variables and constants can be referenced because the value of this variable is needed by the template compiler (positi on 2:22 in the original .ts file), resolving symbol BASE_PATH
If I include the generated proxy as source typescript within the project, I can provide the
BASE_PATH
without this error.Ideally I would like to separate the generated proxy into its own package.
The angular project versions:
Swagger-codegen version
2.3.0-SNAPSHOT
Swagger declaration file content or url
Command line used for generation
Steps to reproduce
On
ng serve
I get the reported error:BASE_PATH Error encountered resolving symbol values statically. Only initialized variables and constants can be referenced because the value of this variable is needed by the template compiler (positi on 2:22 in the original .ts file), resolving symbol BASE_PATH
If instead of packaging as a Node Module, I include as source -- I can provide the BASE_PATH without the compile error.
java -jar swagger-codegen-cli.jar generate -i http://localhost:8080/foo/v2/api-docs -l typescript-angular -o src/foo-proxy
Related issues/PRs
Suggest a fix/enhancement