NotImplementedError: Unexpected scenario where a(n) OpenBraceToken was not found.
See original GitHub issueI tried using the latest build today. It looks like generation isn’t quite there yet for v3.
The YAML I used is here: https://github.com/TylerLeonhardt/AutoRest-PowerShell-Nodejs-Demo/blob/master/FDIC/fdic.yaml The original YAML is here: https://banks.data.fdic.gov/docs/swagger.yaml
PS > autorest-beta --input-file=./fdic.yaml --output-folder=./fdic.js --typescript --use:@autorest/typescript@6.0.0-dev.20200618.1 --v3
AutoRest code generation utility [cli version: 3.0.6187; node: v13.5.0, max-memory: 8192 gb]
(C) 2018 Microsoft Corporation.
https://aka.ms/autorest
Loading AutoRest core '/Users/tyleonha/.autorest/@autorest_core@3.0.6258/node_modules/@autorest/core/dist' (3.0.6258)
Installing AutoRest extension '@autorest/typescript' (6.0.0-dev.20200618.1)
Installed AutoRest extension '@autorest/typescript' (6.0.0-dev.20200618.1->6.0.0-dev.20200618.1)
Loading AutoRest extension '@autorest/modelerfour' (4.13.358->4.13.358)
WARNING (PreCheck/CheckDuplicateSchemas): Checking for duplicate schemas, this could take a (long) while. Run with --verbose for more detail.
An error was encountered while handling a request: NotImplementedError: Unexpected scenario where a(n) OpenBraceToken was not found.
at getTokenEnd (/Users/tyleonha/.autorest/@autorest_typescript@6.0.0-dev.20200618.1/node_modules/ts-morph/dist/ts-morph.js:2524:23)
at Function.getContainerBodyPos (/Users/tyleonha/.autorest/@autorest_typescript@6.0.0-dev.20200618.1/node_modules/ts-morph/dist/ts-morph.js:2516:20)
at getNodes (/Users/tyleonha/.autorest/@autorest_typescript@6.0.0-dev.20200618.1/node_modules/ts-morph/dist/ts-morph.js:2534:48)
at getNodes.next (<anonymous>)
at Function.from (<anonymous>)
at Function.getOrParseChildren (/Users/tyleonha/.autorest/@autorest_typescript@6.0.0-dev.20200618.1/node_modules/ts-morph/dist/ts-morph.js:2476:30)
at Function.getContainerArray (/Users/tyleonha/.autorest/@autorest_typescript@6.0.0-dev.20200618.1/node_modules/ts-morph/dist/ts-morph.js:2697:34)
at ClassDeclaration.getMembersWithComments (/Users/tyleonha/.autorest/@autorest_typescript@6.0.0-dev.20200618.1/node_modules/ts-morph/dist/ts-morph.js:13342:44)
at ClassDeclaration.addConstructor (/Users/tyleonha/.autorest/@autorest_typescript@6.0.0-dev.20200618.1/node_modules/ts-morph/dist/ts-morph.js:13075:69)
at writeConstructor (/Users/tyleonha/.autorest/@autorest_typescript@6.0.0-dev.20200618.1/node_modules/@autorest/typescript/dist/src/generators/clientFileGenerator.js:114:48)
FATAL: Error: Unexpected scenario where a(n) OpenBraceToken was not found.
Error: Plugin typescript reported failure.
For now, I’ll continue using the node.js generator.
Issue Analytics
- State:
- Created 3 years ago
- Comments:11 (11 by maintainers)
Top Results From Across the Web
OpenBraceToken was not found · Issue #665 · dsherret/ts-morph
jsx(node:20537) UnhandledPromiseRejectionWarning: Error: Unexpected scenario where a(n) OpenBraceToken was not found. at getTokenEnd (/Users/ ...
Read more >CoffeeScript compiling: Unexpected IF - Stack Overflow
I am writing some CoffeeScript code for an API, and in the error catching section of my code I placed an IF statement....
Read more >ts-morph @ 2.0.1 .. 2.1.2 - Package Diff
+ throw new errors.NotImplementedError(`Unexpected scenario where a(n) ${utils_1.getSyntaxKindName(kind)} was not found.`);.
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 FreeTop 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
Top GitHub Comments
Looks like it works 😃 thanks!
@TylerLeonhardt thanks for reporting these issues. I’m investigating why the server url in the
swagger
is not being correctly used. The problem seems to be in@azure/core-http
. I have filed an issue in its repo to track this Azure/azure-sdk-for-js/issues/9700I’m going to close this issue as the original problem has been resolved, however feel free to follow the linked Issue, once that one is fixed you should be able to remove the endpoint in the constructor.