apache-superset / superset-ui

Apache Superset UI packages
https://apache-superset.github.io/superset-ui/
Apache License 2.0
330 stars 273 forks source link

Superset-UI plugin not coming up in chart selection wizard after creation. #794

Closed Vishal474 closed 2 years ago

Vishal474 commented 4 years ago

Your question.

Though after successful creation i do not see new chart in expolore -> chart selection wizard. Futher on debugging i came across the warning " Hello_world , You should call configure(...) before calling other methods ".

Kindly help me debug this, Attached the log files.

debugging_log.txt npm-dev-server-logs.txt

issue-label-bot[bot] commented 4 years ago

Issue Label Bot is not confident enough to auto-label this issue. See dashboard for more details.

codepic commented 4 years ago

@Vishal474 this is possibly related to #793

Can you please try to:

  1. stop dev-server
  2. change your plugin's version in package.json to the same as the superset-ui version you're using
  3. change your version reference in incubator-superset/superset-frontend/package.json
  4. run yarn install and yarn build in superset-ui
  5. npm run dev-server in incubator-superset/superset-frontend

And let me know if the issue is fixed?

Vishal474 commented 4 years ago

Hi @codepic, tried the steps suggested but ran into below issues -

  1. Initially at yarn build (step 4), i encountered the error -
@superset-ui/plugin-chart-hello-world: ../../scripts/tsc.sh: line 9: exit: error TS5083: Cannot read file '/home/vishaljeet/Desktop/superset_local/superset-ui/plugins/plugin-chart-hello-world/tsconfig.json'.: numeric argument required
lerna ERR! ../../scripts/tsc.sh       --build exited 2 in '@superset-ui/plugin-chart-hello-world'
lerna WARN complete Waiting for 3 child processes to exit. CTRL-C to exit immediately.
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
  1. After this is referenced #793 and added tsconfig.json to hello-world plugin directory, but now i face this issue -
../../scripts/tsc.sh: line 9: exit: error TS6059: File '/home/vishaljeet/Desktop/superset_local/superset-ui/plugins/plugin-chart-hello-world/src/index.ts' is not under 'rootDir' '/home/vishaljeet/Desktop/superset_local/superset-ui/src'. 'rootDir' is expected to contain all source files.: numeric argument required
lerna ERR! ../../scripts/tsc.sh       --build exited 2 in '@superset-ui/plugin-chart-hello-world'
error Command failed with exit code 2.

Content of tsconfig -

 {
  "compilerOptions": {
    "declarationDir": "lib",
    "outDir": "lib"
  },
  "exclude": [
    "lib",
    "test"
  ],
  "extends": "../../tsconfig.options.json",
  "include": [
    "src/**/*",
    "types/**/*",
    "../../types/**/*"
  ]
}
codepic commented 4 years ago

Hi @Vishal474

In order to yarn build and yarn jest successfully, you need to have 2 tsconfig.json files in your plugin directory.

Your best bet is to copy the following files from plugin-chart-echarts:

# run in superset-ui directory
cp ./plugins/plugin-chart-echarts/tsconfig.json ./plugins/plugin-chart-hello-world/ 
cp ./plugins/plugin-chart-echarts/test/tsconfig.json ./plugins/plugin-chart-hello-world/test/

And after this

# run in superset-ui directory
yarn install
yarn build
yarn jest

And see if all the steps complete without errors.

Vishal474 commented 4 years ago

Hi @codepic

Thanks for the quick update, Adding tsconfig.json to test worked !! Now yarn build and jest are successful. Though i face below error while running dev-server -

TS2305: Module '"../../core/lib"' has no exported member 'supersetTheme'.
ERROR in /home/vishaljeet/Desktop/superset_local/incubator-superset/superset-frontend/node_modules/@superset-ui/plugin-chart-hello-world/src/HelloWorld.tsx(48,26):
TS7031: Binding element 'theme' implicitly has an 'any' type.
ERROR in /home/vishaljeet/Desktop/superset_local/incubator-superset/superset-frontend/node_modules/@superset-ui/plugin-chart-hello-world/src/HelloWorld.tsx(49,17):
TS7031: Binding element 'theme' implicitly has an 'any' type.
ERROR in /home/vishaljeet/Desktop/superset_local/incubator-superset/superset-frontend/node_modules/@superset-ui/plugin-chart-hello-world/src/HelloWorld.tsx(50,23):
TS7031: Binding element 'theme' implicitly has an 'any' type.
ERROR in /home/vishaljeet/Desktop/superset_local/incubator-superset/superset-frontend/node_modules/@superset-ui/plugin-chart-hello-world/src/HelloWorld.tsx(51,16):
TS7031: Binding element 'height' implicitly has an 'any' type.
ERROR in /home/vishaljeet/Desktop/superset_local/incubator-superset/superset-frontend/node_modules/@superset-ui/plugin-chart-hello-world/src/HelloWorld.tsx(52,15):
TS7031: Binding element 'width' implicitly has an 'any' type.
ERROR in /home/vishaljeet/Desktop/superset_local/incubator-superset/superset-frontend/node_modules/@superset-ui/plugin-chart-hello-world/src/HelloWorld.tsx(57,21):
TS7031: Binding element 'theme' implicitly has an 'any' type.
ERROR in /home/vishaljeet/Desktop/superset_local/incubator-superset/superset-frontend/node_modules/@superset-ui/plugin-chart-hello-world/src/HelloWorld.tsx(57,28):
TS7031: Binding element 'headerFontSize' implicitly has an 'any' type.
ERROR in /home/vishaljeet/Desktop/superset_local/incubator-superset/superset-frontend/node_modules/@superset-ui/plugin-chart-hello-world/src/HelloWorld.tsx(58,23):
TS7031: Binding element 'theme' implicitly has an 'any' type.
ERROR in /home/vishaljeet/Desktop/superset_local/incubator-superset/superset-frontend/node_modules/@superset-ui/plugin-chart-hello-world/src/HelloWorld.tsx(58,30):
TS7031: Binding element 'boldText' implicitly has an 'any' type.
ERROR in /home/vishaljeet/Desktop/superset_local/incubator-superset/superset-frontend/node_modules/@superset-ui/plugin-chart-hello-world/src/plugin/buildQuery.ts(19,10):
TS2305: Module '"../../../core/lib"' has no exported member 'buildQueryContext'.
ERROR in /home/vishaljeet/Desktop/superset_local/incubator-superset/superset-frontend/node_modules/@superset-ui/plugin-chart-hello-world/src/plugin/buildQuery.ts(19,29):
TS2305: Module '"../../../core/lib"' has no exported member 'QueryFormData'.
ERROR in /home/vishaljeet/Desktop/superset_local/incubator-superset/superset-frontend/node_modules/@superset-ui/plugin-chart-hello-world/src/plugin/buildQuery.ts(36,38):
TS7006: Parameter 'baseQueryObject' implicitly has an 'any' type.
ERROR in /home/vishaljeet/Desktop/superset_local/incubator-superset/superset-frontend/node_modules/@superset-ui/plugin-chart-hello-world/src/plugin/controlPanel.ts(19,10):
TS2305: Module '"../../../core/lib"' has no exported member 't'.
ERROR in /home/vishaljeet/Desktop/superset_local/incubator-superset/superset-frontend/node_modules/@superset-ui/plugin-chart-hello-world/src/plugin/controlPanel.ts(19,13):
TS2305: Module '"../../../core/lib"' has no exported member 'validateNonEmpty'.
ERROR in /home/vishaljeet/Desktop/superset_local/incubator-superset/superset-frontend/node_modules/@superset-ui/plugin-chart-hello-world/src/plugin/index.ts(19,10):
TS2305: Module '"../../../core/lib"' has no exported member 't'.
ERROR in /home/vishaljeet/Desktop/superset_local/incubator-superset/superset-frontend/node_modules/@superset-ui/plugin-chart-hello-world/src/plugin/index.ts(19,13):
TS2305: Module '"../../../core/lib"' has no exported member 'ChartMetadata'.
ERROR in /home/vishaljeet/Desktop/superset_local/incubator-superset/superset-frontend/node_modules/@superset-ui/plugin-chart-hello-world/src/plugin/index.ts(19,28):
TS2305: Module '"../../../core/lib"' has no exported member 'ChartPlugin'.
ERROR in /home/vishaljeet/Desktop/superset_local/incubator-superset/superset-frontend/node_modules/@superset-ui/plugin-chart-hello-world/src/plugin/transformProps.ts(19,10):
TS2305: Module '"../../../core/lib"' has no exported member 'ChartProps'.
ERROR in /home/vishaljeet/Desktop/superset_local/incubator-superset/superset-frontend/node_modules/@superset-ui/plugin-chart-hello-world/src/plugin/transformProps.ts(19,22):

Under /home/vishaljeet/Desktop/superset_local/incubator-superset/superset-frontend/node_modules/@superset-ui/core/lib/index.d.ts there are no named exports for above mentioned components so the error seems legit. I am unable to understand what could have caused this issue ?

Posting hello-world plugins package.json files for reference as well.

{
  "name": "@superset-ui/plugin-chart-hello-world",
  "version": "0.15.2",
  "description": "Superset Chart - Hello World",
  "sideEffects": false,
  "main": "lib/index.js",
  "module": "esm/index.js",
  "files": [
    "esm",
    "lib"
  ],
  "repository": {
    "type": "git",
    "url": "git+https://github.com/apache-superset/superset-ui.git"
  },
  "keywords": [
    "superset"
  ],
  "author": "Superset",
  "license": "Apache-2.0",
  "bugs": {
    "url": "https://github.com/apache-superset/superset-ui/issues"
  },
  "homepage": "https://github.com/apache-superset/superset-ui#readme",
  "publishConfig": {
    "access": "public"
  },
  "dependencies": {
    "@superset-ui/core": "^0.15.2",
    "@superset-ui/chart-controls": "^0.15.2"
  },
  "peerDependencies": {
    "react": "^16.13.1"
  },
  "devDependencies": {
    "@types/jest": "^26.0.0",
    "jest": "^26.0.1"
  }
}
Vishal474 commented 4 years ago

Hi Team,

I have fixed the above issue by again linking the module using npm link command but this have not resulted in plugin being visible at chart selection wizard.

I am unable to find new plugin in registry constant under VizTypeControl.jsx as well.

If i do not use npm link again, i face the above mentioned error. what could be the issue ?

AydinChavez commented 3 years ago

I had the same issue. What I learned is that the versions of superset-frontend and the superset-ui plugins (including dependencies like the yeoman generator) must really match regarding their versions (e.g. 0.37.2 <-> 0.14.9). Reason is that there are lots of breaking / incompatible changes being introduced in both repos with each release/tag.

This is not really a comfortable situation, see also https://github.com/apache-superset/superset-ui/issues/679

The howto-documentation should make this more clear. It works only for a specific version of superset and superset-ui.

villebro commented 2 years ago

The codebase on this repo has been moved to the main Apache Superset repo, and consequently the repo is in the process of being archived. See the Superset Improvement Proposal for details: https://github.com/apache/superset/issues/13013 . While all currently open issues and PRs will be closed, we encourage you to reopen this issue on the main repo if it is still relevant.