TypeError when creating Datasource Plugin with Grafana Toolkit


I am trying to create a new Datasource Plugin by using the @grafana/toolkit as described there, to test it with the newly-released Grafana 7.0. The first three steps work as expected, however running yarn dev throws a TypeError as shown below:

After googling the error, many posts such as this one in SO suggested deleting node_modules, adding "react-scripts": "^3.4.0" as a dependency, and running yarn install and yarn dev again. However, the problem continued persisting.

I have yarn 1.22.4 running on a Windows 10 machine, with WebStorm as my main IDE. I was also able to use @grafana/toolkit as suggested a couple of months ago (either the 6.7.2 or the 6.7.3 version) and it was building without any issues.

Thanks in advance for the help. Best,

I believe this is an issue with the Powershell/Windows command-line. Check out the answer in this post.

There’s a change in the 7.0.0 release version of toolkit that should fix this issue (does for me anyway), so just double check that you have that version of toolkit

It was set to “next” in package.json when I tested it yesterday, so I assume it was the 7.0.0. However, since the code looked different from the commit in the Git issue you linked, I set it to 7.0.0 manually, deleted node_modules and and ran yarn install again; it was then fine.