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

TypeError: i.readFile is not a function #247

Closed
2 tasks done
orangejohny opened this issue Dec 2, 2024 · 4 comments
Closed
2 tasks done

TypeError: i.readFile is not a function #247

orangejohny opened this issue Dec 2, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@orangejohny
Copy link

orangejohny commented Dec 2, 2024

Describe the bug.

Hi!

There is an error showed in UI when trying to preview asyncapi.yaml containing a reference to a local file. The error is TypeError: i.readFile is not a function.

Vscode info:

Version: 1.95.2 (Universal)
Commit: e8653663e8840adaf45af01eab5c627a5af81807
Date: 2024-11-07T11:07:22.054Z
Electron: 32.2.1
ElectronBuildId: 10427718
Chromium: 128.0.6613.186
Node.js: 20.18.0
V8: 12.8.374.38-electron.0
OS: Darwin x64 24.1.0

asyncapi-preview version: v0.6.5

Expected behavior

asyncapi.yaml renders correctly.

Screenshots

Screenshot 2024-12-02 at 20 30 00

How to Reproduce

  1. Create asyncapi.yaml file with following content:

    asyncapi.yaml
    asyncapi: 2.6.0
    
    info:
      title: Example
      version: '0.1.0'
    defaultContentType: application/json
    
    servers:
      nats:
        protocol: nats
        url: '{protocol}://{host}:{port}'
        variables:
          protocol:
            default: nats
          host:
            default: localhost
          port:
            default: '4222'
    
    channels:
      event/example:
        publish:
          operationId: example
          bindings:
            nats:
              queue: 'event.example'
          message:
            messageId: example
            payload:
              type: object
              allOf:
                - $ref: 'https://raw.githubusercontent.com/cloudevents/spec/v1.0.2/cloudevents/formats/cloudevents.json'
              properties:
                data:
                  $ref: 'cluster.yaml'
  2. Create cluster.yaml file with following content:

    cluster.yaml
    type: object
    properties:
      id:
        type: string
  3. Open asyncapi.yaml preview.

🥦 Browser

None

👀 Have you checked for similar open issues?

  • I checked and didn't find similar issue

🏢 Have you read the Contributing Guidelines?

Are you willing to work on this issue ?

None

@orangejohny orangejohny added the bug Something isn't working label Dec 2, 2024
Copy link

github-actions bot commented Dec 2, 2024

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.

@orangejohny orangejohny changed the title [BUG] TypeError: i.readFile is not a function TypeError: i.readFile is not a function Dec 25, 2024
@r3yc0n1c
Copy link

r3yc0n1c commented Jan 3, 2025

hi, i'd like to work on this

@RyoKikuchi99
Copy link

I faced the same issue. I installed an older version and found that it works up to v0.6.3.
Using v0.6.3 should be a temporary solution.

@ivangsa
Copy link
Collaborator

ivangsa commented Jan 7, 2025

fixed in 7.0.1

@ivangsa ivangsa closed this as completed Jan 7, 2025
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

4 participants