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

Generator crashes due to the error [BABEL] Note: The code generator has deoptimised the styling of asyncapi-ui.min.js as it exceeds the max of 500KB. #1049

Closed
xserrat opened this issue Oct 11, 2023 · 5 comments
Labels
bug Something isn't working

Comments

@xserrat
Copy link

xserrat commented Oct 11, 2023

Describe the bug

When generating the HTML template based on the asyncapi.yaml specification, I've started to receive an error related to the internal js library about Babel:

[BABEL] Note: The code generator has deoptimised the styling of /usr/local/lib/node_modules/@asyncapi/generator/node_modules/@asyncapi/html-template/template/js/asyncapi-ui.min.js as it exceeds the max of 500KB.

How to Reproduce

Steps to reproduce the issue:

  • Create an asyncapi.yaml specification and generate its yaml
  • Screenshots
ag /app/asyncapi/asyncapi.yaml @asyncapi/html-template --force-write -o /tmp/output
[BABEL] Note: The code generator has deoptimised the styling of /usr/local/lib/node_modules/@asyncapi/generator/node_modules/@asyncapi/html-template/template/js/asyncapi-ui.min.js as it exceeds the max of 500KB.
#26 ERROR: executor failed running [/bin/sh -c ag /app/asyncapi/asyncapi.yaml @asyncapi/html-template --force-write -o /tmp/output]: exit code: 137

Expected behavior

I expected a generated HTML templated based on the asyncapi.yaml file provided.

@xserrat xserrat added the bug Something isn't working label Oct 11, 2023
@github-actions
Copy link
Contributor

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.

@jonaslagoni
Copy link
Member

jonaslagoni commented Oct 11, 2023

[BABEL] Note: The code generator has deoptimised the styling of /usr/local/lib/node_modules/@asyncapi/generator/node_modules/@asyncapi/html-template/template/js/asyncapi-ui.min.js as it exceeds the max of 500KB.

Is not the cause of the failed generation, it's just a note and for me, it generates fine (with the warning) 🤔

Is it posting anything else?

@xserrat
Copy link
Author

xserrat commented Oct 11, 2023

You're totally right:

[BABEL] Note: The code generator has deoptimised the styling of /usr/local/lib/node_modules/@asyncapi/generator/node_modules/@asyncapi/html-template/template/js/asyncapi-ui.min.js as it exceeds the max of 500KB.
Warning: Each child in a list should have a unique "key" prop.

Check the top-level render call using <ul>. See https://reactjs.org/link/warning-keys for more information.
    at li
    at Sidebar (/usr/local/lib/node_modules/@asyncapi/generator/node_modules/@asyncapi/react-component/lib/cjs/containers/Sidebar/Sidebar.js:47:35)
    at div
    at section
    at AsyncApiLayout (/usr/local/lib/node_modules/@asyncapi/generator/node_modules/@asyncapi/react-component/lib/cjs/containers/AsyncApi/Layout.js:40:23)
    at AsyncApiComponent (/usr/local/lib/node_modules/@asyncapi/generator/node_modules/@asyncapi/react-component/lib/cjs/containers/AsyncApi/Standalone.js:99:28)
    at AsyncApiComponent (/usr/local/lib/node_modules/@asyncapi/generator/node_modules/@asyncapi/react-component/lib/cjs/containers/AsyncApi/AsyncApi.js:87:28)


Done! ✨
Check out your shiny new generated files at /output/html.

This is the exact output running it locally. I gave you previously the output from a process that runs inside a Docker image and it seems that these warnings may affect to the crash but from your side looks perfect.

We can close the issue, sorry for the confusion 🙏🏽

@xserrat xserrat closed this as completed Oct 11, 2023
@xserrat
Copy link
Author

xserrat commented Oct 13, 2023

@jonaslagoni FYI we got an error related to the version of the html template generator. We fixed that setting the version to the compatible one (0.28.4):

docker.io/asyncapi/generator:1.13.1 /app/asyncapi/asyncapi.yaml @asyncapi/[email protected] --force-write -o /output/html

@jonaslagoni
Copy link
Member

Every logging so far only showed warnings, nothing that indicates what caused the crash 😅

And since you can successfully run it locally, it has to do with your CI setup I would assume 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants