grafana / simple-json-backend-datasource

simple-json datasource with alerting support
MIT License
18 stars 15 forks source link

Error: Fetch error: 404 Not Found Instantiating #8

Open HernanMora opened 4 years ago

HernanMora commented 4 years ago

Hi! After all steps for building I get the following error:

Error: Fetch error: 404 Not Found Instantiating http://localhost:3000/public/plugins/grafana-simple-json-backend-datasource/module.js Loading plugins/grafana-simple-json-backend-datasource/module

There is no module.js file, only .ts files in the dist folder. How can it be solved?

HadesArchitect commented 4 years ago

Hi @HernanMora,

  1. How exactly did you build the project?
  2. Could you try to build the project using steps from https://github.com/HadesArchitect/simple-json-backend-datasource/blob/build-docs/README.md?

Answering your question, it looks like the typescipt files were not transpiled to javascript leading to the issue. The build process was incorrect.

HernanMora commented 4 years ago

Hi @HadesArchitect

I used the Local Way and the Makefile but now I'm going to try the Docker way

HadesArchitect commented 4 years ago

Oh cool. I tested only docker way because I don't have all the deps installed locally. Thank you for the bug report, I will take a look.

HadesArchitect commented 4 years ago

@HernanMora Ok I see what's the problem. There is a missing step in build process, webpack is needed to compile typescript files, I haven't included it.

HadesArchitect commented 4 years ago

Meanwhile you may take a look at https://github.com/HadesArchitect/grafana-cassandra-source as an example, branch backend is the most up to date. Works well with typescript.

HadesArchitect commented 4 years ago

Yep, fixed it, works correctly now. I'll push an update soon.

image

HernanMora commented 4 years ago

Thank you! I will be taking a look

HadesArchitect commented 4 years ago

Fixed and updated, please try to follow the new instructions.

https://github.com/HadesArchitect/simple-json-backend-datasource/tree/build-docs

HernanMora commented 4 years ago

Docker way works correctly, I will use this method. Thank you for the speed in solving my problem, you do an excellent job!

l3pond commented 3 years ago

Hello there! I'm really new in this area, and I'm having trouble building this project.

Unfortunately, I didn't manage to build the project on Windows 10. Docker didn't seem to work at all for me. Through the Local Way, I managed to do step 1 and 2 (yarn install and webpack). However, I just can't make the dep ensure step to work. I get the following error:

C:\PROGRA~1\GrafanaLabs\grafana\data\plugins\simple-json-backend-datasource-master>dep ensure
root project import: C:\PROGRA~1\GrafanaLabs\grafana\data\plugins\simple-json-backend-datasource-master is not within any GOPATH/src

My go env directories are:

set GO111MODULE=
set GOARCH=amd64
set GOBIN=C:\Progra~1\GrafanaLabs\grafana\data\plugins\simple-json-backend-datasource-master\bin
set GOCACHE=C:\Users\ENGENHARIA-03\AppData\Local\go-build
set GOENV=C:\Users\ENGENHARIA-03\AppData\Roaming\go\env
set GOEXE=.exe
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOINSECURE=
set GOMODCACHE=C:\Progra~1\GrafanaLabs\grafana\data\plugins\simple-json-backend-datasource-master\pkg\mod
set GONOPROXY=
set GONOSUMDB=
set GOOS=windows
set GOPATH=C:\Progra~1\GrafanaLabs\grafana\data\plugins\simple-json-backend-datasource-master
set GOPRIVATE=
set GOPROXY=https://proxy.golang.org,direct
set GOROOT=c:\go
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLDIR=c:\go\pkg\tool\windows_amd64
set GCCGO=gccgo
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=C:\Users\ENGENHARIA-03\AppData\Local\Temp\go-build240940786=/tmp/go-build -gno-record-gcc-switches

Any ideas of what might be happening?