apiaryio / apiary-client

Apiary CLI client
https://help.apiary.io/tools/apiary-cli/
MIT License
204 stars 70 forks source link

Browser console not working with "--server --preview" option #175

Closed ggicci closed 3 years ago

ggicci commented 6 years ago

Hi, I started a server at localhost by using command:

apiary preview --server --port=9000 --watch --path="./api-description.apib" &>/dev/null

but I can't switch to console. If I click the button Switch to Console, it will print errors in the console:

> Uncaught TypeError: Cannot read property '_id' of undefined
    at a.initialize (docs-5c21b62e.js:1)
    at a.c (docs-5c21b62e.js:1)
    at a (docs-5c21b62e.js:1)
    at new a (docs-5c21b62e.js:1)
    at a.renderErrorView (docs-5c21b62e.js:1)
    at a.render (docs-5c21b62e.js:1)
    at a.renderConsoleView (docs-5c21b62e.js:1)
    at a.render (docs-5c21b62e.js:1)
    at a.initConsoleView (docs-5c21b62e.js:1)
    at a.renderConsoleView (docs-5c21b62e.js:1)

> GET chrome-extension://invalid/ net::ERR_FAILED

And my apiary cli version is 0.11.1.

tu1ly commented 6 years ago

@ggicci thanks for the report. could you pls send me api-description.apib and info about browser you are using ?

ggicci commented 6 years ago

Here is the content of api-description.apib:

FORMAT: 1A
HOST: http://localhost:2546

# The Spiderman API

> Spiderman is the central API service for SM - a crawling framework.

This is the document demonstrates how to access the **Spiderman** service.

# Group Symbols

## Symbol [/v1/symbols/{id}]
A symbol represents a trading pair, which named in format `{exchange}.{base}.{quote}`.

+ Parameters
    + id (number)
        The ID of the desired symbol.

+ Attributes (object)
    + ID: 1 (number)
    + CreatedAt: `2006-01-02T15:04:05-07:00` (string)
    + UpdatedAt: `2006-01-02T15:04:05-07:00` (string)
    + Symbol: huobipro.btc.usdt (string)
    + Exchange: huobipro (string, required)
    + AssetBase: btc (string, required)
    + AssetQuote: usdt (string, required)

### Retrieve a symbol [GET]
Retrieves a symbol with the given ID.

+ Request sample
    + Parameters
        + id: `6`
+ Response 200 (application/json)
    + Attributes (Symbol)

## Symbols [/v1/symbols{?symbol,exchange,asset_base,asset_quote,symbol_type,ccxt_schedule,aicoin_schedule,page,page_size}]

+ Attributes (array[Symbol])

### List symbols [GET]
Get a list of symbols.

+ Parameters
    + symbol: `binance.btc.usdt` (string) - fullname of a symbol in format: `exchange.base.quote`
    + exchange: `binance` (string) - name of the exchange
    + asset_base: `btc` (string) - name of the base asset
    + asset_quote: `usdt` (string) - name of the quote asset
    + symbol_type: `spot` (string) - type of symbol, one of `spot`, `future`
    + ccxt_schedule: `off` (string) - switch of ccxt crawler
    + aicoin_schedule: `off` (string) - switch of aicoin crawler
    + page: `1` (number) - page index
    + page_size: `10` (number) - page size

+ Request filter by exchange
    + Parameters
        + exchange: `binance`
        + asset_base: `btc`
        + page_size: `3`

+ Response 200 (application/json)
    + Attributes (Symbols)

### Create a symbol [POST]
Creates a new symbol.

+ Attributes (Symbol)

+ Request (application/json)

+ Response 201 (application/json)
    + Attributes (Symbol)

Ane I use google chrome of version Version 69.0.3497.81 (Official Build) (64-bit).

ggicci commented 5 years ago

Hi, is there any progress?

tu1ly commented 5 years ago

hi, unfortunately no

zloyboldin commented 5 years ago

I have the same problem BUT! Everything is fine on Firefox

cyberbudy commented 5 years ago

I have an error in my console on Firefox 68 this.applicationModel.get(...).get(...)

abtris commented 3 years ago

Try in latest version if issue still valid.