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

Blank page when generating html doc #1063

Closed
mamyn0va opened this issue Nov 9, 2023 · 6 comments
Closed

Blank page when generating html doc #1063

mamyn0va opened this issue Nov 9, 2023 · 6 comments
Labels
bug Something isn't working

Comments

@mamyn0va
Copy link

mamyn0va commented Nov 9, 2023

Describe the bug

When I generate the html doc from my asyncapi file, and I open it in my browser, I get a blank page (nothing displayed).

How to Reproduce

I use asyncapi/cli version 0.60.0.

asyncapi generate fromTemplate asyncapi.yml --force-write @asyncapi/html-template -o public/asyncapi

asyncapi.yml

asyncapi: 2.5.0
info:
  title: Example
  version: 0.1.0
channels:
  user/signedup:
    subscribe:
      message:
        description: An event describing that a user just signed up.
        payload:
          type: object
          additionalProperties: false
          properties:
            fullName:
              type: string
            email:
              type: string
              format: email
            age:
              type: integer
              minimum: 18

Expected behavior

A nice asyncapi documentation.

@mamyn0va mamyn0va added the bug Something isn't working label Nov 9, 2023
Copy link
Contributor

github-actions bot commented Nov 9, 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.

@sl-nigelalmada
Copy link

sl-nigelalmada commented Nov 9, 2023

I'm also experimenting the issue when running the following command :

npx @asyncapi/generator@1.14.1 asyncapi.yaml @asyncapi/html-template@1.0.0 --force-write -p singleFile=true -p outFilename=events.html

Which is weird since I'm using a fixed version for both @asyncapi/generator and @asyncapi/html-template and that nothing new has been released recently on both (was working fine 6 days ago)

By using the --debug flag, I've this :

Unable to resolve template location at undefined. Package is not available locally. Error: Cannot find module '@asyncapi/html-template@1.0.0/package.json'
Require stack:
- /usr/local/lib/node_modules/noop.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:995:15)
    at Function.Module._resolveFilename.sharedData.moduleResolveFilenameHook.installedValue [as _resolveFilename] (/home/redacted/.npm/_npx/48b847941f53c355/node_modules/@asyncapi/generator/node_modules/@cspotcode/source-map-support/source-map-support.js:811:30)
    at resolveFileName (/home/redacted/.npm/_npx/48b847941f53c355/node_modules/@asyncapi/generator/node_modules/resolve-from/index.js:29:39)
    at resolveFrom (/home/redacted/.npm/_npx/48b847941f53c355/node_modules/@asyncapi/generator/node_modules/resolve-from/index.js:43:9)
    at module.exports (/home/redacted/.npm/_npx/48b847941f53c355/node_modules/@asyncapi/generator/node_modules/resolve-from/index.js:46:47)
    at utils.getTemplateDetails (/home/redacted/.npm/_npx/48b847941f53c355/node_modules/@asyncapi/generator/lib/utils.js:207:30)
    at /home/redacted/.npm/_npx/48b847941f53c355/node_modules/@asyncapi/generator/lib/generator.js:509:26
    at new Promise (<anonymous>)
    at Generator.installTemplate (/home/redacted/.npm/_npx/48b847941f53c355/node_modules/@asyncapi/generator/lib/generator.js:502:12)
    at Generator.installAndSetupTemplate (/home/redacted/.npm/_npx/48b847941f53c355/node_modules/@asyncapi/generator/lib/generator.js:259:73)
    at Generator.generate (/home/redacted/.npm/_npx/48b847941f53c355/node_modules/@asyncapi/generator/lib/generator.js:174:16)
    at Generator.generateFromFile (/home/redacted/.npm/_npx/48b847941f53c355/node_modules/@asyncapi/generator/lib/generator.js:472:17)
    at async /home/redacted/.npm/_npx/48b847941f53c355/node_modules/@asyncapi/generator/cli.js:157:9 {
  code: 'MODULE_NOT_FOUND',
  requireStack: [ '/usr/local/lib/node_modules/noop.js' ]
}
Template installation started because the template cannot be found on disk.
Template @asyncapi/html-template successfully installed in /home/redacted/.npm/_npx/48b847941f53c355/node_modules/@asyncapi/generator/node_modules/@asyncapi/html-template.
Version of used template is 1.0.0.
[BABEL] Note: The code generator has deoptimised the styling of /home/redacted/.npm/_npx/48b847941f53c355/node_modules/@asyncapi/generator/node_modules/@asyncapi/html-template/template/js/asyncapi-ui.min.js as it exceeds the max of 500KB.
File /home/redacted/sources/media/prject/api-doc/index.html.js couldn't be found. Error: ENOENT: no such file or directory, stat '/home/redacted/sources/media/prject/api-doc/index.html.js'
File /home/redacted/sources/media/prject/api-doc/js/asyncapi-ui.min.js couldn't be found. Error: ENOENT: no such file or directory, stat '/home/redacted/sources/media/prject/api-doc/js/asyncapi-ui.min.js'
File /home/redacted/sources/media/prject/api-doc/css/asyncapi.min.css couldn't be found. Error: ENOENT: no such file or directory, stat '/home/redacted/sources/media/prject/api-doc/css/asyncapi.min.css'
File /home/redacted/sources/media/prject/api-doc/css/global.min.css couldn't be found. Error: ENOENT: no such file or directory, stat '/home/redacted/sources/media/prject/api-doc/css/global.min.css'


Done! ✨
Check out your shiny new generated files at /home/redacted/sources/media/prject/api-doc.

@mamyn0va
Copy link
Author

mamyn0va commented Nov 9, 2023 via email

@sl-nigelalmada
Copy link

Downgrading to @asyncapi/generator@1.12.0 and @asyncapi/html-template@0.28.4 fixes the issue for me

@mamyn0va
Copy link
Author

Thanks @sl-nigelalmada I confirm this fixes the issue for me too.

@jonaslagoni
Copy link
Member

Lets continue in asyncapi/html-template#456

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

3 participants