grafana / grafana

The open and composable observability and data visualization platform. Visualize metrics, logs, and traces from multiple sources like Prometheus, Loki, Elasticsearch, InfluxDB, Postgres and many more.
https://grafana.com
GNU Affero General Public License v3.0
64.15k stars 12.01k forks source link

Plugin not building when updating from 7.0.3 to 7.1.0 #26038

Closed ryantxu closed 4 years ago

ryantxu commented 4 years ago

I tied updating newrelic to use "next"... and hit some issues :(

  [./types.ts] 628 bytes {module} [built]
  [@grafana/data] external "@grafana/data" 42 bytes {module} [built]
      + 26 hidden modules

  ERROR in /home/ryan/workspace/grafana/plugins/newrelic-datasource/src/components/ConfigEditor.tsx
  ERROR in /home/ryan/workspace/grafana/plugins/newrelic-datasource/src/components/ConfigEditor.tsx(76,18):
  TS2741: Property 'css' is missing in type '{ className: string; placeholder: string; disabled: true; }' but required in type 'Pick<Props, "children" | "cite" | "data" | "form" | "label" | "slot" | "span" | "style" | "summary" | "title" | "pattern" | "value" | "start" | "key" | "selected" | "prefix" | ... 347 more ... | "addonAfter">'.

  ERROR in /home/ryan/workspace/grafana/plugins/newrelic-datasource/src/components/ConfigEditor.tsx
  ERROR in /home/ryan/workspace/grafana/plugins/newrelic-datasource/src/components/ConfigEditor.tsx(78,18):
  TS2741: Property 'css' is missing in type '{ className: string; value: string; placeholder: string; required: true; onChange: (event: SyntheticEvent<HTMLInputElement | HTMLSelectElement, Event>) => void; }' but required in type 'Pick<Props, "children" | "cite" | "data" | "form" | "label" | "slot" | "span" | "style" | "summary" | "title" | "pattern" | "value" | "start" | "key" | "selected" | "prefix" | ... 347 more ... | "addonAfter">'.

  ERROR in /home/ryan/workspace/grafana/plugins/newrelic-datasource/src/components/ConfigEditor.tsx
  ERROR in /home/ryan/workspace/grafana/plugins/newrelic-datasource/src/components/ConfigEditor.tsx(108,18):
  TS2741: Property 'css' is missing in type '{ className: string; placeholder: string; disabled: true; }' but required in type 'Pick<Props, "children" | "cite" | "data" | "form" | "label" | "slot" | "span" | "style" | "summary" | "title" | "pattern" | "value" | "start" | "key" | "selected" | "prefix" | ... 347 more ... | "addonAfter">'.

  ERROR in /home/ryan/workspace/grafana/plugins/newrelic-datasource/src/components/ConfigEditor.tsx
  ERROR in /home/ryan/workspace/grafana/plugins/newrelic-datasource/src/components/ConfigEditor.tsx(110,18):
  TS2741: Property 'css' is missing in type '{ className: string; value: string; placeholder: string; required: true; onChange: (event: SyntheticEvent<HTMLInputElement | HTMLSelectElement, Event>) => void; }' but required in type 'Pick<Props, "children" | "cite" | "data" | "form" | "label" | "slot" | "span" | "style" | "summary" | "title" | "pattern" | "value" | "start" | "key" | "selected" | "prefix" | ... 347 more ... | "addonAfter">'.

  ERROR in /home/ryan/workspace/grafana/plugins/newrelic-datasource/src/components/ConfigEditor.tsx
  ERROR in /home/ryan/workspace/grafana/plugins/newrelic-datasource/src/components/ConfigEditor.tsx(140,18):
  TS2741: Property 'css' is missing in type '{ className: string; placeholder: string; disabled: true; }' but required in type 'Pick<Props, "children" | "cite" | "data" | "form" | "label" | "slot" | "span" | "style" | "summary" | "title" | "pattern" | "value" | "start" | "key" | "selected" | "prefix" | ... 347 more ... | "addonAfter">'.

  ERROR in /home/ryan/workspace/grafana/plugins/newrelic-datasource/src/components/ConfigEditor.tsx
  ERROR in /home/ryan/workspace/grafana/plugins/newrelic-datasource/src/components/ConfigEditor.tsx(142,18):
  TS2741: Property 'css' is missing in type '{ className: string; value: string; placeholder: string; required: true; onChange: (event: SyntheticEvent<HTMLInputElement | HTMLSelectElement, Event>) => void; }' but required in type 'Pick<Props, "children" | "cite" | "data" | "form" | "label" | "slot" | "span" | "style" | "summary" | "title" | "pattern" | "value" | "start" | "key" | "selected" | "prefix" | ... 347 more ... | "addonAfter">'.

  ERROR in /home/ryan/workspace/grafana/plugins/newrelic-datasource/src/editor/QueryEditor.tsx
  ERROR in /home/ryan/workspace/grafana/plugins/newrelic-datasource/src/editor/QueryEditor.tsx(25,38):
  TS2344: Type 'NewRelicDatasource' does not satisfy the constraint 'DataSourceApi<NewRelicQuery, NewRelicJsonData>'.
    The types returned by 'query(...)' are incompatible between these types.
      Type 'Observable<DataQueryResponse>' is not assignable to type 'Promise<DataQueryResponse> | Observable<DataQueryResponse>'.
        Type 'import("/home/ryan/workspace/grafana/plugins/newrelic-datasource/node_modules/rxjs/internal/Observable").Observable<import("/home/ryan/workspace/grafana/plugins/newrelic-datasource/node_modules/@grafana/data/types/datasource").DataQueryResponse>' is not assignable to type 'import("/home/ryan/workspace/grafana/plugins/newrelic-datasource/node_modules/@grafana/data/node_modules/rxjs/internal/Observable").Observable<import("/home/ryan/workspace/grafana/plugins/newrelic-datasource/node_modules/@grafana/data/types/datasource").DataQueryResponse>'.
          The types of 'source.operator.call' are incompatible between these types.
            Type '(subscriber: import("/home/ryan/workspace/grafana/plugins/newrelic-datasource/node_modules/rxjs/internal/Subscriber").Subscriber<any>, source: any) => import("/home/ryan/workspace/grafana/plugins/newrelic-datasource/node_modules/rxjs/internal/types").TeardownLogic' is not assignable to type '(subscriber: import("/home/ryan/workspace/grafana/plugins/newrelic-datasource/node_modules/@grafana/data/node_modules/rxjs/internal/Subscriber").Subscriber<any>, source: any) => import("/home/ryan/workspace/grafana/plugins/newrelic-datasource/node_modules/@grafana/data/node_modules/rxjs/internal/types").TeardownLogic'.
              Types of parameters 'subscriber' and 'subscriber' are incompatible.
                Type 'import("/home/ryan/workspace/grafana/plugins/newrelic-datasource/node_modules/@grafana/data/node_modules/rxjs/internal/Subscriber").Subscriber<any>' is not assignable to type 'import("/home/ryan/workspace/grafana/plugins/newrelic-datasource/node_modules/rxjs/internal/Subscriber").Subscriber<any>'.
                  Property 'isStopped' is protected but type 'Subscriber<T>' is not a class derived from 'Subscriber<T>'.

  ERROR in /home/ryan/workspace/grafana/plugins/newrelic-datasource/src/editor/QueryEditor.tsx
  ERROR in /home/ryan/workspace/grafana/plugins/newrelic-datasource/src/editor/QueryEditor.tsx(371,14):
  TS2741: Property 'css' is missing in type '{ value: string; className: string; placeholder: string; onChange: (event: ChangeEvent<HTMLInputElement>) => void; onBlur: () => void; }' but required in type 'Pick<Props, "children" | "cite" | "data" | "form" | "label" | "slot" | "span" | "style" | "summary" | "title" | "pattern" | "value" | "start" | "key" | "selected" | "prefix" | ... 347 more ... | "addonAfter">'.

  ERROR in /home/ryan/workspace/grafana/plugins/newrelic-datasource/src/editor/QueryEditor.tsx
  ERROR in /home/ryan/workspace/grafana/plugins/newrelic-datasource/src/editor/QueryEditor.tsx(383,14):
  TS2741: Property 'css' is missing in type '{ value: string | number; className: string; placeholder: string; onChange: (event: ChangeEvent<HTMLInputElement>) => void; onBlur: () => void; }' but required in type 'Pick<Props, "children" | "cite" | "data" | "form" | "label" | "slot" | "span" | "style" | "summary" | "title" | "pattern" | "value" | "start" | "key" | "selected" | "prefix" | ... 347 more ... | "addonAfter">'.

  ERROR in /home/ryan/workspace/grafana/plugins/newrelic-datasource/src/module.ts
  ERROR in /home/ryan/workspace/grafana/plugins/newrelic-datasource/src/module.ts(8,44):
  TS2344: Type 'NewRelicDatasource' does not satisfy the constraint 'DataSourceApi<NewRelicQuery, NewRelicJsonData>'.
    The types returned by 'query(...)' are incompatible between these types.
      Type 'Observable<DataQueryResponse>' is not assignable to type 'Promise<DataQueryResponse> | Observable<DataQueryResponse>'.
        Type 'import("/home/ryan/workspace/grafana/plugins/newrelic-datasource/node_modules/rxjs/internal/Observable").Observable<import("/home/ryan/workspace/grafana/plugins/newrelic-datasource/node_modules/@grafana/data/types/datasource").DataQueryResponse>' is not assignable to type 'import("/home/ryan/workspace/grafana/plugins/newrelic-datasource/node_modules/@grafana/data/node_modules/rxjs/internal/Observable").Observable<import("/home/ryan/workspace/grafana/plugins/newrelic-datasource/node_modules/@grafana/data/types/datasource").DataQueryResponse>'.

  ERROR in /home/ryan/workspace/grafana/plugins/newrelic-datasource/src/module.ts
  ERROR in /home/ryan/workspace/grafana/plugins/newrelic-datasource/src/module.ts(10,20):
  TS2345: Argument of type 'typeof ConfigEditor' is not assignable to parameter of type 'ComponentType<DataSourcePluginOptionsEditorProps<NewRelicJsonData, unknown>>'.
    Type 'typeof ConfigEditor' is not assignable to type 'ComponentClass<DataSourcePluginOptionsEditorProps<NewRelicJsonData, unknown>, any>'.
      Types of parameters 'props' and 'props' are incompatible.
        Type 'DataSourcePluginOptionsEditorProps<NewRelicJsonData, unknown>' is not assignable to type 'Props'.
          Types of property 'options' are incompatible.
            Type 'DataSourceSettings<NewRelicJsonData, unknown>' is not assignable to type 'DataSourceSettings<NewRelicJsonData, NewRelicSecureJsonData>'.
              Type 'unknown' is not assignable to type 'NewRelicSecureJsonData'.

  Trace: Build failed
      at /home/ryan/workspace/grafana/plugins/newrelic-datasource/node_modules/@grafana/toolkit/src/cli/utils/useSpinner.js:25:29
      at step (/home/ryan/workspace/grafana/plugins/newrelic-datasource/node_modules/@grafana/toolkit/node_modules/tslib/tslib.js:136:27)
      at Object.throw (/home/ryan/workspace/grafana/plugins/newrelic-datasource/node_modules/@grafana/toolkit/node_modules/tslib/tslib.js:117:57)
      at rejected (/home/ryan/workspace/grafana/plugins/newrelic-datasource/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'm not sure if this is caused by a real change or a linting/ts issue

ryantxu commented 4 years ago

hymm, some seems cased by this difference:


'import("/home/ryan/workspace/grafana/plugins/newrelic-datasource/node_modules/                           rxjs/internal/Observable").Observable<import("/home/ryan/workspace/grafana/plugins/newrelic-datasource/node_modules/@grafana/data/types/datasource").DataQueryResponse>' is not assignable to type 
'import("/home/ryan/workspace/grafana/plugins/newrelic-datasource/node_modules/@grafana/data/node_modules/rxjs/internal/Observable").Observable<import("/home/ryan/workspace/grafana/plugins/newrelic-datasource/node_modules/@grafana/data/types/datasource").DataQueryResponse>'.
dprokop commented 4 years ago

closed by https://github.com/grafana/grafana/pull/26039