Generator: Error: Docker container can't generate html

Created on 14 Sep 2020  路  9Comments  路  Source: asyncapi/generator

Describe the bug

Docker container can't start because [email protected] generate error like:

Something went wrong:
Template render error: (/app/node_modules/@asyncapi/html-template/template/index.html)
Template render error: (/app/node_modules/@asyncapi/html-template/partials/content.html)
Template render error: (/app/node_modules/@asyncapi/html-template/partials/operations.html)
Error: Unable to call `p["circularProps"]`, which is undefined or falsey
at Object._prettifyError (/app/node_modules/nunjucks/src/lib.js:36:11)
at /app/node_modules/nunjucks/src/environment.js:561:19
at eval (eval at _compile (/app/node_modules/nunjucks/src/environment.js:631:18), <anonymous>:118:12)
at /app/node_modules/nunjucks/src/environment.js:569:11
at eval (eval at _compile (/app/node_modules/nunjucks/src/environment.js:631:18), <anonymous>:64:12)
at /app/node_modules/nunjucks/src/environment.js:569:11
at eval (eval at _compile (/app/node_modules/nunjucks/src/environment.js:631:18), <anonymous>:10:11)
at /app/node_modules/nunjucks/src/environment.js:611:9
at eval (eval at _compile (/app/node_modules/nunjucks/src/environment.js:631:18), <anonymous>:54:12)
at /app/node_modules/nunjucks/src/environment.js:611:9
at eval (eval at _compile (/app/node_modules/nunjucks/src/environment.js:631:18), <anonymous>:21:11)
at /app/node_modules/nunjucks/src/environment.js:611:9
at Template.root [as rootRenderFunc] (eval at _compile (/app/node_modules/nunjucks/src/environment.js:631:18), <anonymous>:42:3)
at Template.getExported (/app/node_modules/nunjucks/src/environment.js:609:10)
at eval (eval at _compile (/app/node_modules/nunjucks/src/environment.js:631:18), <anonymous>:20:5)
at Environment.getTemplate (/app/node_modules/nunjucks/src/environment.js:277:9)

How to Reproduce

I tried asyncapi/generator:1.0.0-rc.10 container, but it reproduce on asyncapi/generator:0.53.1 also.

Inside the container, I call
node cli.js -o /data/public /data/web.yml @asyncapi/html-template --force-write

Expected behavior

Should work and generate HTML.

bug

Most helpful comment

@derberg it works for me too! Thank you for help

All 9 comments

Welcome to AsyncAPI. Thanks a lot for reporting your first issue.

Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out this issue.

@Ellocsys you mean you're getting error with latest generator too or only older? circularProps is a new prop added to schema b the parser, in generator rc.10, maybe since rc.8

@derberg latest (tried on asyncapi/generator:1.0.0-rc.10) and older (tried on asyncapi/generator:0.53.1 and asyncapi/generator:0.50.0).

@Ellocsys could you share your schema file?

@Ellocsys the circularProps() operates on the properties of the object. If there is no x-parser-circular-props propert added to the object by the parser, then it just returns undefines. So I just need to see your schemas to see what is wrong with them, or what is wrong with my assumption 馃槃

I have a similar problem with circularProps.

package.json

    "@asyncapi/generator": "^0.53.1",
    "@asyncapi/html-template": "^0.12.0"

yaml:

asyncapi: "2.0.0"
id: "urn:api"
info:
  title: Example title
  version: 0.1.0
  description: Example description
channels:
  test:
    publish:
      message:
        oneOf:
          - $ref: "#/components/messages/exampleMessage"
components:
  messages:
    exampleMessage:
      description: Example message
      payload:
        type: object
        required:
          - name
        properties:
          name:
            type: string
            default: "Name"
            description: "Name"

Error:

Something went wrong:
Template render error: (.../node_modules/@asyncapi/generator/node_modules/@asyncapi/html-template/template/index.html)
  Template render error: (.../node_modules/@asyncapi/generator/node_modules/@asyncapi/html-template/partials/content.html)
  Template render error: (.../node_modules/@asyncapi/generator/node_modules/@asyncapi/html-template/partials/operations.html)
  Error: Unable to call `p["circularProps"]`, which is undefined or falsey
    at Object._prettifyError (.../node_modules/nunjucks/src/lib.js:36:11)
    at .../node_modules/nunjucks/src/environment.js:561:19
    at eval (eval at _compile (.../node_modules/nunjucks/src/environment.js:631:18), <anonymous>:120:12)
    at .../node_modules/nunjucks/src/environment.js:569:11
    at eval (eval at _compile (.../node_modules/nunjucks/src/environment.js:631:18), <anonymous>:66:12)
    at .../node_modules/nunjucks/src/environment.js:569:11
    at eval (eval at _compile (.../node_modules/nunjucks/src/environment.js:631:18), <anonymous>:12:11)
    at .../node_modules/nunjucks/src/environment.js:611:9
    at eval (eval at _compile (.../node_modules/nunjucks/src/environment.js:631:18), <anonymous>:56:12)
    at .../node_modules/nunjucks/src/environment.js:611:9

@Igor-lkm could you please first upgrade to latest generator v1.0.0-rc.11? The previous versions of generator did not use latest parser that adds those circularProps

@derberg works! thank you

@derberg it works for me too! Thank you for help

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bali182 picture bali182  路  11Comments

jonaslagoni picture jonaslagoni  路  5Comments

marcortw picture marcortw  路  7Comments

fmvilas picture fmvilas  路  9Comments

aravindajju picture aravindajju  路  9Comments