Skip to content

Everything breaks after upgrading to version 1.0.0 #456

@albertodiazdorado

Description

@albertodiazdorado

Describe the bug

yarn upgrade @asyncapi/html-template@0.28.4
yarn build # works
yarn serve # works

yarn upgrade @asyncapi/html-template@latest
yarn add react@^17.0.2 # peer dependency
yarn build # works?
yarn serve # blank page

I think that the problem is that the generated index.html looks like this (notice shema = undefined):

    <body>
      <div id="root"></div>
  
      <script src="js/asyncapi-ui.min.js" type="application/javascript"></script>
  
      <script>
        const schema = undefined;
        const config = {"show":{"sidebar":true},"sidebar":{"showOperations":"byDefault"}};
        AsyncApiStandalone.hydrate({ schema, config }, document.getElementById("root"));
      </script>
    </body>

I use the generator like this:

import Generator from "@asyncapi/generator"; // Version 1.14.1

const main = async () => {
  const generator = new Generator(
    "@asyncapi/html-template",
    path.resolve(process.cwd(), `./dist`),
  );
  const yamlFile = await fsPromises.readFile(
    path.resolve(__dirname, "./api-config.yaml"),
    "utf-8",
  );
  await generator.generate(yamlFile);
};

main();

Do you have any idea on how to fix? Or how to migrate from version 0.x to 1.x? I could not find any migration guide.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions