asyncapi / html-template

HTML template for AsyncAPI Generator. Use it to generate a static docs. It is using AsyncAPI React component under the hood.
65 stars 59 forks source link

TypeError: message.id is not a function #438

Closed muenchhausen closed 1 year ago

muenchhausen commented 1 year ago

Describe the bug

TypeError: message.id is not a function

How to Reproduce

Use asyncapi.yml with the following content

asyncapi: '2.6.0'
info:
  title: Account Service
  version: 1.0.0
  description: This service is in charge of processing user signups
channels:
  user/signedup:
    subscribe:
      message:
        $ref: '#/components/messages/UserSignedUp'
components:
  messages:
    UserSignedUp:
      payload:
        type: object
        properties:
          displayName:
            type: string
            description: Name of the user
          email:
            type: string
            format: email
            description: Email of the user

run

npm install  @asyncapi/generator
ag asyncapi.yml @asyncapi/html-template -o out

Something went wrong:
TypeError: message.id is not a function
    at /Users/derk/node_modules/@asyncapi/generator/node_modules/@asyncapi/react-component/src/containers/Sidebar/Sidebar.tsx:51:64
    at Array.map (<anonymous>)
    at Sidebar (/Users/derk/node_modules/@asyncapi/generator/node_modules/@asyncapi/react-component/src/containers/Sidebar/Sidebar.tsx:44:35)
    at processChild (/Users/derk/node_modules/@asyncapi/generator/node_modules/react-dom/cjs/react-dom-server.node.development.js:3353:14)
    at resolve (/Users/derk/node_modules/@asyncapi/generator/node_modules/react-dom/cjs/react-dom-server.node.development.js:3270:5)
    at ReactDOMServerRenderer.render (/Users/derk/node_modules/@asyncapi/generator/node_modules/react-dom/cjs/react-dom-server.node.development.js:3753:22)
    at ReactDOMServerRenderer.read (/Users/derk/node_modules/@asyncapi/generator/node_modules/react-dom/cjs/react-dom-server.node.development.js:3690:29)
    at Object.renderToString (/Users/derk/node_modules/@asyncapi/generator/node_modules/react-dom/cjs/react-dom-server.node.development.js:4298:27)
    at Context.renderSpec (/Users/derk/node_modules/@asyncapi/generator/node_modules/@asyncapi/html-template/filters/all.js:165:25)
    at eval (eval at _compile (/Users/derk/node_modules/@asyncapi/generator/node_modules/nunjucks/src/environment.js:527:18), <anonymous>:38:97)
    at Context.generateBase64Favicon (/Users/derk/node_modules/@asyncapi/generator/node_modules/@asyncapi/html-template/filters/all.js:105:12)
    at Template.root [as rootRenderFunc] (eval at _compile (/Users/derk/node_modules/@asyncapi/generator/node_modules/nunjucks/src/environment.js:527:18), <anonymous>:21:40)
    at Template.render (/Users/derk/node_modules/@asyncapi/generator/node_modules/nunjucks/src/environment.js:454:10)
    at Environment.renderString (/Users/derk/node_modules/@asyncapi/generator/node_modules/nunjucks/src/environment.js:313:17)
    at /Users/derk/node_modules/@asyncapi/generator/lib/renderer/nunjucks.js:32:14
    at new Promise (<anonymous>)

Expected behavior

no error

I use node v18.16.0 and ag version 1.10.14, but this occurs since yesterday also on other versions!

github-actions[bot] commented 1 year ago

Welcome to AsyncAPI. Thanks a lot for reporting your first issue. Please check out our contributors guide and the instructions about a basic recommended setup useful for opening a pull request.
Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out this issue.

M3lkior commented 1 year ago

Same issue here since this morning with node16, and generator in v1.9.0 with no codebase changes

pioneer2k commented 1 year ago

For us as well with the GitHub Action of the generator

asyncapi-bot commented 1 year ago

:tada: This issue has been resolved in version 0.28.4 :tada:

The release is available on:

Your semantic-release bot :package::rocket: