Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in web component - Uncaught TypeError: Cannot read properties of undefined (reading 'alloc') #813

Closed
Bizordec opened this issue Oct 7, 2023 · 4 comments · Fixed by #816
Labels

Comments

@Bizordec
Copy link
Contributor

Bizordec commented Oct 7, 2023

Description

AsyncAPI web component is not working on the latest versions, this error is shown in the console:
image

Expected result

Web component is rendered.

Actual result

A white screen is shown.

Steps to reproduce

Create an index.html file with this content and open it in the browser:

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>1.0.2</title>
  </head>
  <body>
    <script src="https://unpkg.com/@webcomponents/[email protected]/webcomponents-bundle.js"></script>
    <script
      src="https://unpkg.com/@asyncapi/[email protected]/lib/asyncapi-web-component.js"
      defer
    ></script>

    <asyncapi-component
      schemaUrl="https://raw.githubusercontent.com/asyncapi/spec/v2.6.0/examples/streetlights-kafka.yml"
      config='{"show": {"info": false}}'
      schemaFetchOptions='{"method":"GET","mode":"cors"}'
      cssImportPath="https://unpkg.com/@asyncapi/[email protected]/styles/default.min.css"
    >
    </asyncapi-component>
  </body>
</html>

Or open it in CodeSandbox:
https://codesandbox.io/s/thirsty-kowalevski-gsctyj?file=/index.html

Troubleshooting

Rollback to 1.0.0-next.48 version.

@github-actions
Copy link

github-actions bot commented Oct 7, 2023

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.

@derberg
Copy link
Member

derberg commented Oct 7, 2023

I can't figure out why it got broken other than refresh of dependencies that we had to do.
Maybe the only solution is hammer, and switch from current package that generated web component from react, to something that is more regularly maintained -https://www.npmjs.com/package/react-to-webcomponent

@LuigiAlice
Copy link

Same problem here

@asyncapi-bot
Copy link
Contributor

🎉 This issue has been resolved in version 1.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants