discoveryjs / discovery

A framework for rapid data (JSON) analysis, shareable serverless reports and dashboards
https://discoveryjs.github.io/discovery/
MIT License
336 stars 6 forks source link

Error if run discovery without .discovery.js config #49

Closed ZvezdocheTag closed 4 years ago

ZvezdocheTag commented 4 years ago

Follow by this article https://dev.to/rdvornov/discovery-js-tutorials-quick-start-m3k, discovery should work without .discovery.js configuration file. But after the initial run and then open URL http://localhost:8123/ I get these errors:

Cmd:

➜  puppet npx discovery
No config is used
  Models are not defined (model free mode is enabled) 
Init common routes ... OK

Server listen on http://localhost:8123

/Users/fronty/Documents/code/pets/puppet/node_modules/@discoveryjs/cli/bin/asset:67
    throw e;
    ^

TypeError: Cannot read property 'view' of null
    at /Users/fronty/Documents/code/pets/puppet/node_modules/@discoveryjs/cli/lib/asset.js:217:30
    at /Users/fronty/Documents/code/pets/puppet/node_modules/@discoveryjs/cli/lib/shared/bootstrap.js:24:12
    at Command.action_ (/Users/fronty/Documents/code/pets/puppet/node_modules/@discoveryjs/cli/bin/asset:32:9)
    at Command.run (/Users/fronty/Documents/code/pets/puppet/node_modules/clap/lib/command.js:331:28)
    at Object.<anonymous> (/Users/fronty/Documents/code/pets/puppet/node_modules/@discoveryjs/cli/bin/asset:58:13)
    at Module._compile (internal/modules/cjs/loader.js:1133:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1153:10)
    at Module.load (internal/modules/cjs/loader.js:977:32)
    at Function.Module._load (internal/modules/cjs/loader.js:877:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12)
/Users/fronty/Documents/code/pets/puppet/node_modules/@discoveryjs/cli/bin/asset:67
    throw e;
    ^

Browser console:

Refused to apply style from 'http://localhost:8123/gen/model-view.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.
model-libs.js:1 Failed to load resource: the server responded with a status of 500 (Internal Server Error)
localhost/:1 Refused to apply style from 'http://localhost:8123/gen/model-libs.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.
lahmatiy commented 4 years ago

Thank you for the bug report! Fixed in discovery-cli 1.10.3