grafana / mqtt-datasource

MQTT Datasource for Grafana allows streaming data from any MQTT broker running either locally or remotely.
Apache License 2.0
171 stars 51 forks source link

The newest version doesn't compile on Windows. #26

Closed KirannBhavaraju closed 2 years ago

KirannBhavaraju commented 2 years ago

Hey guys, I have all the dependencies installed. and all the paths set so that these things are found..

Yarn build however doesnt compile and throws a Type A not assignable to Type B error on my windows machine..

PS C:\Users\kib\Desktop\Projects\mqtt datasource for grafana\grafana-plugins\mqtt-datasource> yarn build
yarn run v1.22.15
warning ..\..\..\..\..\package.json: No license field
$ rm -rf dist && grafana-toolkit plugin:build && mage build:backend
'rm' is not recognized as an internal or external command,
operable program or batch file.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
PS C:\Users\kib\Desktop\Projects\mqtt datasource for grafana\grafana-plugins\mqtt-datasource> yarn build
yarn run v1.22.15
warning ..\..\..\..\..\package.json: No license field
$ rimraf dist && grafana-toolkit plugin:build && mage build:backend
  Using Node.js v16.5.0
  Using @grafana/toolkit v8.2.0-beta.2
√ Preparing
√ Linting
 PASS  src/handleEvent.test.ts

Test Suites: 1 passed, 1 total
Tests:       2 passed, 2 total
Snapshots:   2 passed, 2 total
Time:        5.271 s
Ran all test suites with tests matching "".
√ Running tests
- Compiling...  Starting type checking service...
  Using 1 worker with 2048MB memory limit
- Compiling...  ERROR in C:/Users/kib/Desktop/Projects/mqtt datasource for grafana/grafana-plugins/mqtt-datasource/src/ConfigEditor.tsx(53,17):
  TS2322: Type '{ name: string; required: true; value: string; css: string; autoComplete: string; onChange: (event: ChangeEvent<HTMLInputElement>) => void; }' is not assignable to type 'IntrinsicAttributes & Pick<Props, "onSubmit" | "accept" | "acceptCharset" | "action" | "allowFullScreen" | "allowTransparency" | "alt" | "as" | ... 354 more ... | "addonAfter"> & RefAttributes<...>'.
    Property 'css' does not exist on type 'IntrinsicAttributes & Pick<Props, "onSubmit" | "accept" | "acceptCharset" | "action" | "allowFullScreen" | "allowTransparency" | "alt" | "as" | ... 354 more ... | "addonAfter"> & RefAttributes<...>'.
  ERROR in C:/Users/kib/Desktop/Projects/mqtt datasource for grafana/grafana-plugins/mqtt-datasource/src/ConfigEditor.tsx(64,17):
  TS2322: Type '{ type: string; name: string; required: true; value: number; css: string; autoComplete: string; onChange: (event: ChangeEvent<HTMLInputElement>) => void; }' is not assignable to type 'IntrinsicAttributes & Pick<Props, "onSubmit" | "accept" | "acceptCharset" | "action" | "allowFullScreen" | "allowTransparency" | "alt" | "as" | ... 354 more ... | "addonAfter"> & RefAttributes<...>'.
    Property 'css' does not exist on type 'IntrinsicAttributes & Pick<Props, "onSubmit" | "accept" | "acceptCharset" | "action" | "allowFullScreen" | "allowTransparency" | "alt" | "as" | ... 354 more ... | "addonAfter"> & RefAttributes<...>'.
  ERROR in C:/Users/kib/Desktop/Projects/mqtt datasource for grafana/grafana-plugins/mqtt-datasource/src/ConfigEditor.tsx(76,17):
  TS2322: Type '{ name: string; value: string | undefined; css: string; autoComplete: string; onChange: (event: ChangeEvent<HTMLInputElement>) => void; }' is not assignable to type 'IntrinsicAttributes & Pick<Props, "onSubmit" | "accept" | "acceptCharset" | "action" | "allowFullScreen" | "allowTransparency" | "alt" | "as" | ... 354 more ... | "addonAfter"> & RefAttributes<...>'.
    Property 'css' does not exist on type 'IntrinsicAttributes & Pick<Props, "onSubmit" | "accept" | "acceptCharset" | "action" | "allowFullScreen" | "allowTransparency" | "alt" | "as" | ... 354 more ... | "addonAfter"> & RefAttributes<...>'.
  ERROR in C:/Users/kib/Desktop/Projects/mqtt datasource for grafana/grafana-plugins/mqtt-datasource/src/ConfigEditor.tsx(85,17):
  TS2322: Type '{ type: string; name: string; css: string; autoComplete: string; placeholder: string; value: string; onChange: (event: ChangeEvent<HTMLInputElement>) => void; onReset: () => void; }' is not assignable to type 'IntrinsicAttributes & Pick<Props, "onSubmit" | "accept" | "acceptCharset" | "action" | "allowFullScreen" | "allowTransparency" | "alt" | "as" | ... 354 more ... | "addonAfter"> & RefAttributes<...>'.
    Property 'css' does not exist on type 'IntrinsicAttributes & Pick<Props, "onSubmit" | "accept" | "acceptCharset" | "action" | "allowFullScreen" | "allowTransparency" | "alt" | "as" | ... 354 more ... | "addonAfter"> & RefAttributes<...>'.
  ERROR in C:/Users/kib/Desktop/Projects/mqtt datasource for grafana/grafana-plugins/mqtt-datasource/src/QueryEditor.tsx(22,13):
  TS2322: Type '{ name: string; required: true; value: string | undefined; css: string; autoComplete: string; onChange: (event: ChangeEvent<HTMLInputElement>) => void; }' is not assignable to type 'IntrinsicAttributes & Pick<Props, "onSubmit" | "accept" | "acceptCharset" | "action" | "allowFullScreen" | "allowTransparency" | "alt" | "as" | ... 354 more ... | "addonAfter"> & RefAttributes<...>'.
    Property 'css' does not exist on type 'IntrinsicAttributes & Pick<Props, "onSubmit" | "accept" | "acceptCharset" | "action" | "allowFullScreen" | "allowTransparency" | "alt" | "as" | ... 354 more ... | "addonAfter"> & RefAttributes<...>'.
× Build failed
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Faulty files

  1. src\configEditor.tsx

    • image
  2. src\QueryEditor.tsx

Versions

  1. Yarn : v1.22.15
  2. Go : go1.17.1 windows/amd64
  3. Mage: Mage Build Tool v1.11.0-4-gdd94424, Commit: dd94424
  4. Node: v16.5.0
atifali commented 2 years ago

@KirannBhavaraju i just tried building the datasource from source on my windows machine with the following tool versions:

  1. yarn: 1.22.17
  2. Go: go version go1.17.6 windows/amd64
  3. Mage: Mage Build Tool v1.12.1; Commit: 2f1ec40
  4. Node: v16.13.1

it compiles fine on my end - do you mind updating your local tools and then trying again? maybe its just a version issue

KirannBhavaraju commented 2 years ago

@atifali Yeah, you use newer versions of every dependency almost. I wrote the issue 3 mo ago.. which was the case then. I did not try it recently..

but nice to see it is fixed.

atifali commented 2 years ago

@KirannBhavaraju cool yeah if you do want to give this another shot i would suggest using those versions and report back if any issues - closing this now