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

rsp.headers is not a function ERROR #66

Open
vinilima07 opened this issue Jun 5, 2020 · 10 comments
Open

rsp.headers is not a function ERROR #66

vinilima07 opened this issue Jun 5, 2020 · 10 comments

Comments

@vinilima07
Copy link

vinilima07 commented Jun 5, 2020

My grafana version is 6.7.0
My ajax plugin is the latest.
I am trying to use the plugin and i am getting the error in dev tools console after call a post request, the request is sent normally and the response is get normally to.

image

This is making the ajax plugin to not render the message that is sent on response but after i click in grafana refresh button the previous message is rendered.

@amotl
Copy link

amotl commented Jun 5, 2020

Dear Vinicius,

this is probably a duplicate of #60 and might have been fixed through #64 already. If you will be able to build this plugin for yourself, it might help you along.

With kind regards,
Andreas.

@vinilima07
Copy link
Author

vinilima07 commented Jun 5, 2020

@amotl Thank you so much, so, until they merge the commit with master i did the same modifications in the file that the commit do, but i am having problem building the plugin:
This is my error, any orientation will be very helpful.
image

the error is showed up after i run: yarn build

@amotl
Copy link

amotl commented Jun 5, 2020

Dear Vinicius,

I just tried and had no problems building the vanilla master using yarn install followed by yarn build.

The Prettier is sometimes a bit picky, so it might just be this guy complaining.

You might well want to directly clone https://github.com/BlackLight/ajax-panel. Thanks again for the fix, @blacklight.

With kind regards,
Andreas.

@amotl
Copy link

amotl commented Jun 5, 2020

Indeed, after switching to @blacklight's fork, I am also getting (different) errors:

  ERROR in /Users/amo/dev/panodata/sources/ajax-panel/src/module.ts
  [tsl] ERROR in /Users/amo/dev/panodata/sources/ajax-panel/src/module.ts(499,31)
        TS2554: Expected 1 arguments, but got 0.

  ERROR in /Users/amo/dev/panodata/sources/ajax-panel/src/module.ts
  [tsl] ERROR in /Users/amo/dev/panodata/sources/ajax-panel/src/module.ts(507,18)
        TS2349: This expression is not callable.
    Type 'typeof import("/Users/amo/dev/panodata/sources/ajax-panel/node_modules/@grafana/data/index")' has no call signatures.

amotl added a commit to panodata/ajax-panel that referenced this issue Jun 5, 2020
This tries to use [1] and builds for me now.

[1] ryantxu#64
@amotl
Copy link

amotl commented Jun 5, 2020

Dear Vinicius,

[1] fixes the build for me. However, I haven't tested it on a real Grafana instance.

With kind regards,
Andreas.

[1] https://github.com/panodata/ajax-panel/tree/fixfixfix

@vinilima07
Copy link
Author

vinilima07 commented Jun 5, 2020

Dear @amotl ,
I tried to use BlackLigh solution, but for me this modifications only remove the 'type function error'. So i made some modifications based on this #60 (comment)
This modifications was a solution to Panel refresh problem, now when he receive the response from server he is refreshed,
it wasn't happening before. I will post my solution and make a pull request as soon as i can.

Again, thank you very much!

@vinilima07
Copy link
Author

I made a solution for this issue and two other issues i think!
#60 (comment)
#65 (comment)
my repo:
https://github.com/viniciusfdev/ajax-panel.git

@robertpascale i think this will help you!

@robertpascale
Copy link

Hi @viniciusfdev ,
That's great - but I'm not sure how I can use your patch. I currently run grafana in a docker container on a NAS box, and I just add the plugin via the docker environment variable as follows:
GF_INSTALL_PLUGINS=ryantxu-ajax-panel
I don't have any way of compiling my own and even if I did, I'm not sure how I would embed it in the docker container.
Hopefully @ryantxu may action the pull request and roll it in to the next production release.

@vinilima07
Copy link
Author

Dear @robertpascale,
I'm also running grafana on the docker, if you really need this fix as early as I do, just clone my repository, install all the dependencies needed to create the grafana plugin like @ grafana / tools and yarn, run 'yarn install' and 'yarn build ', doing this, a folder called' dist 'will appear, the' dist 'folder is used by grafana to create a plugin, so you need to put this' dist' folder inside another folder as' ajax-plugin 'and put inside the directory / data / plugis in the grafana container (with docker cp or using volumes).

@kavdev
Copy link

kavdev commented Oct 16, 2020

running into this with grafana 7.1.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants