Closed SpAndrea117 closed 3 years ago
I'm sorry that you weren't able to get it working. Could you try using npx @grafana/toolkit plugin:create my-plugin
instead (remove @next
)?
Came here with the same issue and tried using the toolkit without @next. Unfortunately without success. Errors seem similar. yarn-build-out-redacted.txt
Could you confirm if you're still having issues with this?
Closing as this has gone more than six months with no activity.
Hi i'm trying to follow the Build a data source backend plugin tutorial on the grafana official page, but I obtain the following error:
`>yarn install yarn install v1.22.5 [1/5] Validating package.json... [2/5] Resolving packages... [3/5] Fetching packages... warning Pattern ["@grafana/data@next"] is trying to unpack in the same destination "C:\Users\a.spampinato\AppData\Local\Yarn\Cache\v6\npm-@grafana-data-7.2.0-29ae47a1c8a331d12fa269ef900922ade829c0aa-integrity\node_modules\@grafana\data" as pattern ["@grafana/data@^7.0.0","@grafana/data@7.2.0","@grafana/data@7.2.0"]. This could result in non-deterministic behavior, skipping. info fsevents@1.2.13: The platform "win32" is incompatible with this module. info "fsevents@1.2.13" is an optional dependency and failed compatibility check. Excluding it from installation. info fsevents@2.1.3: The platform "win32" is incompatible with this module. info "fsevents@2.1.3" is an optional dependency and failed compatibility check. Excluding it from installation. [4/5] Linking dependencies... warning "@grafana/toolkit > @grafana/eslint-config@2.0.0" has incorrect peer dependency "prettier@^2.0.5". warning "@grafana/toolkit > @grafana/eslint-config@2.0.0" has incorrect peer dependency "typescript@^3.9.6". warning "@grafana/toolkit > @grafana/ui > @grafana/slate-react > slate-react-placeholder@0.2.9" has unmet peer dependency "slate-react@>=0.22.0". [5/5] Building fresh packages... Done in 168.40s.
C:\Users\a.spampinato\Desktop\grafana-plugins\my-plugin-be>yarn build yarn run v1.22.5 $ grafana-toolkit plugin:build √ Preparing √ Linting
Running tests Using standard jest plugin config C:\Users\a.spampinato\Desktop\grafana-plugins\my-plugin-be\node_modules\@grafana\toolkit\src\config\jest.plugin.config.local.js No tests found, exiting with code 0 √ Running tests \ Compiling... Starting type checking service... Using 1 worker with 2048MB memory limit / Compiling... ERROR in C:/Users/a.spampinato/Desktop/grafana-plugins/my-plugin-be/src/module.ts(7,44): TS2344: Type 'DataSource' does not satisfy the constraint 'DataSourceApi<MyQuery, MyDataSourceOptions>'. The types returned by 'query(...)' are incompatible between these types. Type 'Observable' is not assignable to type 'Promise | Observable'.
Type 'import("C:/Users/a.spampinato/Desktop/grafana-plugins/my-plugin-be/node_modules/rxjs/internal/Observable").Observableimport("C:/Users/a.spampinato/Desktop/grafana-plugins/my-plugin-be/node_modules/@grafana/data/types/datasource").DataQueryResponse' is not assignable to type 'import("C:/Users/a.spampinato/Desktop/grafana-plugins/my-plugin-be/node_modules/@grafana/data/node_modules/rxjs/internal/Observable").Observableimport("C:/Users/a.spampinato/Desktop/grafana-plugins/my-plugin-be/node_modules/@grafana/data/types/datasource").DataQueryResponse'.
ERROR in C:/Users/a.spampinato/Desktop/grafana-plugins/my-plugin-be/src/module.ts(8,20):
TS2345: Argument of type 'typeof ConfigEditor' is not assignable to parameter of type 'ComponentType<DataSourcePluginOptionsEditorProps<MyDataSourceOptions, unknown>>'.
Type 'typeof ConfigEditor' is not assignable to type 'ComponentClass<DataSourcePluginOptionsEditorProps<MyDataSourceOptions, unknown>, any>'.
Types of parameters 'props' and 'props' are incompatible.
Type 'DataSourcePluginOptionsEditorProps<MyDataSourceOptions, unknown>' is not assignable to type 'Readonly'.
Types of property 'options' are incompatible.
Type 'DataSourceSettings<MyDataSourceOptions, unknown>' is not assignable to type 'DataSourceSettings<MyDataSourceOptions, {}>'.
Type 'unknown' is not assignable to type '{}'.
ERROR in C:/Users/a.spampinato/Desktop/grafana-plugins/my-plugin-be/src/QueryEditor.tsx(11,31):
TS2344: Type 'DataSource' does not satisfy the constraint 'DataSourceApi<MyQuery, MyDataSourceOptions>'.
The types returned by 'query(...)' are incompatible between these types.
Type 'Observable' is not assignable to type 'Promise | Observable'.
Type 'import("C:/Users/a.spampinato/Desktop/grafana-plugins/my-plugin-be/node_modules/rxjs/internal/Observable").Observableimport("C:/Users/a.spampinato/Desktop/grafana-plugins/my-plugin-be/node_modules/@grafana/data/types/datasource").DataQueryResponse' is not assignable to type 'import("C:/Users/a.spampinato/Desktop/grafana-plugins/my-plugin-be/node_modules/@grafana/data/node_modules/rxjs/internal/Observable").Observableimport("C:/Users/a.spampinato/Desktop/grafana-plugins/my-plugin-be/node_modules/@grafana/data/types/datasource").DataQueryResponse'.
The types of 'source.operator.call' are incompatible between these types.
Type '(subscriber: import("C:/Users/a.spampinato/Desktop/grafana-plugins/my-plugin-be/node_modules/rxjs/internal/Subscriber").Subscriber, source: any) => import("C:/Users/a.spampinato/Desktop/grafana-plugins/my-plugin-be/node_modules/rxjs/internal/types").TeardownLogic' is not assignable to type '(subscriber: import("C:/Users/a.spampinato/Desktop/grafana-plugins/my-plugin-be/node_modules/@grafana/data/node_modules/rxjs/internal/Subscriber").Subscriber, source: any) => import("C:/Users/a.spampinato/Desktop/grafana-plugins/my-plugin-be/node_modules/@grafana/data/node_modules/rxjs/internal/types").Teardown...'.
Types of parameters 'subscriber' and 'subscriber' are incompatible.
Type 'import("C:/Users/a.spampinato/Desktop/grafana-plugins/my-plugin-be/node_modules/@grafana/data/node_modules/rxjs/internal/Subscriber").Subscriber' is not assignable to type 'import("C:/Users/a.spampinato/Desktop/grafana-plugins/my-plugin-be/node_modules/rxjs/internal/Subscriber").Subscriber'.
Property 'isStopped' is protected but type 'Subscriber' is not a class derived from 'Subscriber'.
Hash: df80c967dd4b15ad47c1 Version: webpack 4.41.5 Time: 9159ms Built at: 2020-10-09 13:19:15 Asset Size Chunks Chunk Names LICENSE 11.3 KiB [emitted] README.md 2.22 KiB [emitted] img/logo.svg 1.55 KiB [emitted] module.js 11.3 KiB 0 [emitted] module module.js.LICENSE.txt 808 bytes [emitted] module.js.map 71.3 KiB 0 [emitted] [dev] module plugin.json 792 bytes [emitted] Entrypoint module = module.js module.js.map [0] external "react" 42 bytes {0} [built] [1] external "@grafana/ui" 42 bytes {0} [built] [2] ../node_modules/lodash/isObject.js 733 bytes {0} [built] [6] ../node_modules/lodash/identity.js 370 bytes {0} [built] [10] ../node_modules/lodash/eq.js 799 bytes {0} [built] [11] ../node_modules/lodash/isArrayLike.js 830 bytes {0} [built] [13] ../node_modules/lodash/_isIndex.js 759 bytes {0} [built] [15] external "@grafana/data" 42 bytes {0} [built] [16] external "@grafana/runtime" 42 bytes {0} [built] [17] ../node_modules/lodash/defaults.js 1.71 KiB {0} [built] [18] ../node_modules/lodash/_baseRest.js 559 bytes {0} [built] [19] ../node_modules/lodash/_overRest.js 1.07 KiB {0} [built] [35] ../node_modules/lodash/_isIterateeCall.js 877 bytes {0} [built] [36] ../node_modules/lodash/keysIn.js 778 bytes {0} [built] [51] ./module.ts + 5 modules 15.1 KiB {0} [built] | ./module.ts 296 bytes [built] | ./DataSource.ts 352 bytes [built] | ./ConfigEditor.tsx 2.68 KiB [built] | ./QueryEditor.tsx 1.7 KiB [built] | ../node_modules/tslib/tslib.es6.js 10 KiB [built] | ./types.ts 46 bytes [built]
ERROR in C:/Users/a.spampinato/Desktop/grafana-plugins/my-plugin-be/src/module.ts ERROR in C:/Users/a.spampinato/Desktop/grafana-plugins/my-plugin-be/src/module.ts(7,44): TS2344: Type 'DataSource' does not satisfy the constraint 'DataSourceApi<MyQuery, MyDataSourceOptions>'. The types returned by 'query(...)' are incompatible between these types. Type 'Observable' is not assignable to type 'Promise | Observable'.
Type 'import("C:/Users/a.spampinato/Desktop/grafana-plugins/my-plugin-be/node_modules/rxjs/internal/Observable").Observableimport("C:/Users/a.spampinato/Desktop/grafana-plugins/my-plugin-be/node_modules/@grafana/data/types/datasource").DataQueryResponse' is not assignable to type 'import("C:/Users/a.spampinato/Desktop/grafana-plugins/my-plugin-be/node_modules/@grafana/data/node_modules/rxjs/internal/Observable").Observableimport("C:/Users/a.spampinato/Desktop/grafana-plugins/my-plugin-be/node_modules/@grafana/data/types/datasource").DataQueryResponse'.
ERROR in C:/Users/a.spampinato/Desktop/grafana-plugins/my-plugin-be/src/module.ts ERROR in C:/Users/a.spampinato/Desktop/grafana-plugins/my-plugin-be/src/module.ts(8,20): TS2345: Argument of type 'typeof ConfigEditor' is not assignable to parameter of type 'ComponentType<DataSourcePluginOptionsEditorProps<MyDataSourceOptions, unknown>>'. Type 'typeof ConfigEditor' is not assignable to type 'ComponentClass<DataSourcePluginOptionsEditorProps<MyDataSourceOptions, unknown>, any>'. Types of parameters 'props' and 'props' are incompatible. Type 'DataSourcePluginOptionsEditorProps<MyDataSourceOptions, unknown>' is not assignable to type 'Readonly'.
Types of property 'options' are incompatible.
Type 'DataSourceSettings<MyDataSourceOptions, unknown>' is not assignable to type 'DataSourceSettings<MyDataSourceOptions, {}>'.
Type 'unknown' is not assignable to type '{}'.
ERROR in C:/Users/a.spampinato/Desktop/grafana-plugins/my-plugin-be/src/QueryEditor.tsx ERROR in C:/Users/a.spampinato/Desktop/grafana-plugins/my-plugin-be/src/QueryEditor.tsx(11,31): TS2344: Type 'DataSource' does not satisfy the constraint 'DataSourceApi<MyQuery, MyDataSourceOptions>'. The types returned by 'query(...)' are incompatible between these types. Type 'Observable' is not assignable to type 'Promise | Observable'.
Type 'import("C:/Users/a.spampinato/Desktop/grafana-plugins/my-plugin-be/node_modules/rxjs/internal/Observable").Observableimport("C:/Users/a.spampinato/Desktop/grafana-plugins/my-plugin-be/node_modules/@grafana/data/types/datasource").DataQueryResponse' is not assignable to type 'import("C:/Users/a.spampinato/Desktop/grafana-plugins/my-plugin-be/node_modules/@grafana/data/node_modules/rxjs/internal/Observable").Observableimport("C:/Users/a.spampinato/Desktop/grafana-plugins/my-plugin-be/node_modules/@grafana/data/types/datasource").DataQueryResponse'.
The types of 'source.operator.call' are incompatible between these types.
Type '(subscriber: import("C:/Users/a.spampinato/Desktop/grafana-plugins/my-plugin-be/node_modules/rxjs/internal/Subscriber").Subscriber, source: any) => import("C:/Users/a.spampinato/Desktop/grafana-plugins/my-plugin-be/node_modules/rxjs/internal/types").TeardownLogic' is not assignable to type '(subscriber: import("C:/Users/a.spampinato/Desktop/grafana-plugins/my-plugin-be/node_modules/@grafana/data/node_modules/rxjs/internal/Subscriber").Subscriber, source: any) => import("C:/Users/a.spampinato/Desktop/grafana-plugins/my-plugin-be/node_modules/@grafana/data/node_modules/rxjs/internal/types").Teardown...'.
Types of parameters 'subscriber' and 'subscriber' are incompatible.
Type 'import("C:/Users/a.spampinato/Desktop/grafana-plugins/my-plugin-be/node_modules/@grafana/data/node_modules/rxjs/internal/Subscriber").Subscriber' is not assignable to type 'import("C:/Users/a.spampinato/Desktop/grafana-plugins/my-plugin-be/node_modules/rxjs/internal/Subscriber").Subscriber'.
Property 'isStopped' is protected but type 'Subscriber' is not a class derived from 'Subscriber'.
Trace: Build failed at C:\Users\a.spampinato\Desktop\grafana-plugins\my-plugin-be\node_modules\@grafana\toolkit\src\cli\utils\useSpinner.js:25:29 at step (C:\Users\a.spampinato\Desktop\grafana-plugins\my-plugin-be\node_modules\@grafana\toolkit\node_modules\tslib\tslib.js:136:27) at Object.throw (C:\Users\a.spampinato\Desktop\grafana-plugins\my-plugin-be\node_modules\@grafana\toolkit\node_modules\tslib\tslib.js:117:57) at rejected (C:\Users\a.spampinato\Desktop\grafana-plugins\my-plugin-be\node_modules\@grafana\toolkit\node_modules\tslib\tslib.js:108:69) at processTicksAndRejections (internal/process/task_queues.js:97:5) × Build failed error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.`
I've also find some post asking help for the same problem but I was not able to find out the solution to fix it. Any help would be appreciated.
I'm adding the link of these posts, maybe they can be helpful.
https://github.com/grafana/grafana/issues/23377, https://github.com/grafana/grafana/pull/23577, https://github.com/melchiormoulin/grafana/commit/2bd06b4af2d8c2fe74640395b01b46946c62fd5f