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.

NotImplementedError: Unexpected scenario where a(n) OpenBraceToken was not found.

See original GitHub issue

I 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:closed
  • Created 3 years ago
  • Comments:11 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
TylerLeonhardtcommented, Jun 25, 2020

Looks like it works 😃 thanks!

1reaction
joheredicommented, Jun 24, 2020

@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/9700

I’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.

Read more comments on GitHub >

github_iconTop 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 >

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