swagger-api / swagger-api/swagger-codegen
[Typescript-Angular2] Token must be defined in AOT
Nobody has claimed this yet.
- Dominant language
- Mustache
- Stars
- 17.8k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
Description
Hello
i am trying to build my angular / ionic app with generated code from swagger. In JIT mode everything works fine.
Using AOT i get following error
main.js:formatted:304 ERROR Error: Uncaught (in promise): Error: Token must be defined!
Error: Token must be defined!
at new t (main.js:formatted:3624)
at t.get (main.js:formatted:3655)
at Function.t.get (main.js:formatted:3634)
at t.get (main.js:formatted:3980)
at e.get [as _UserApi_74] (main.js:formatted:33500)
at e.get [as _LoginProvider_97] (main.js:formatted:33652)
at e.getInternal (
For me it looks like as _UserApi_74, which is a generated artefact produces the error
Swagger-codegen version
2.2.3
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the reported Swagger Codegen 2.2.3 output in an Angular AOT build, comparing it with the working JIT build. Trace the generated _UserApi_74 and _LoginProvider_97 entries from the stack trace to the token error. Done means the generated TypeScript client builds and runs under AOT without "Token must be defined!".
Written by the indexing model from the issue text.
Assessment
- Tech stack
- angular, typescript
- Domain
- frontend, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100