mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
WebAssets: improve checks and error messages on dtos (#92093)
fix web assets check and improve error message
This commit is contained in:
parent
d27c3822f2
commit
80a69319b0
@ -121,17 +121,17 @@ func readWebAssets(r io.Reader) (*dtos.EntryPointAssets, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if entryPoints.App == nil || len(entryPoints.App.Assets.JS) == 0 {
|
if entryPoints.App == nil || len(entryPoints.App.Assets.JS) == 0 {
|
||||||
return nil, fmt.Errorf("missing app entry")
|
return nil, fmt.Errorf("missing app entry, try running `yarn build`")
|
||||||
}
|
}
|
||||||
if entryPoints.Dark == nil || len(entryPoints.Dark.Assets.CSS) == 0 {
|
if entryPoints.Dark == nil || len(entryPoints.Dark.Assets.CSS) == 0 {
|
||||||
return nil, fmt.Errorf("missing dark entry")
|
return nil, fmt.Errorf("missing dark entry, try running `yarn build`")
|
||||||
}
|
}
|
||||||
if entryPoints.Light == nil || len(entryPoints.Light.Assets.CSS) == 0 {
|
if entryPoints.Light == nil || len(entryPoints.Light.Assets.CSS) == 0 {
|
||||||
return nil, fmt.Errorf("missing light entry")
|
return nil, fmt.Errorf("missing light entry, try running `yarn build`")
|
||||||
|
}
|
||||||
|
if entryPoints.Swagger == nil || len(entryPoints.Swagger.Assets.JS) == 0 {
|
||||||
|
return nil, fmt.Errorf("missing swagger entry, try running `yarn build`")
|
||||||
}
|
}
|
||||||
// if entryPoints.Swagger == nil || len(entryPoints.Swagger.Assets.JS) == 0 {
|
|
||||||
// return nil, fmt.Errorf("missing swagger entry")
|
|
||||||
// }
|
|
||||||
|
|
||||||
rsp := &dtos.EntryPointAssets{
|
rsp := &dtos.EntryPointAssets{
|
||||||
JSFiles: make([]dtos.EntryPointAsset, 0, len(entryPoints.App.Assets.JS)),
|
JSFiles: make([]dtos.EntryPointAsset, 0, len(entryPoints.App.Assets.JS)),
|
||||||
|
Loading…
Reference in New Issue
Block a user