Reputation: 21
I'm using Apache Superset 1.3.2 (not in Docker), Ubuntu 19.
I created (yo @superset-ui/superset) and built (yarn build) a custom plugin. It works fine then I run "npm run dev-server". I run "yarn build" plugin. I think that I will see this custom chart then I run superset run -p 8080
. I didn't see my chart. What I need to change, if I want to see my custom chart?
Is it possible to upload custom plugin into GitHub, not npmjs.org? What kind of files should be uploaded? Just the esm and lib folders? Is it possible to publish custom plugin automatically?
How can I install this chart from GitHub, then I will upload it?
Upvotes: 2
Views: 2953
Reputation: 95
I don't know what happens exactly when you go to production but you have to follow the directions exactly to see the chart. You will not see it on localhost:8080
. It runs on the proxy and you see it on localhost:9000
.
I am working my way through the first chart and I do see the horizontal bar chart I created. It was not fun getting started up especially as I have never done react
, typescript
or d3
.
Follow these instructions as I am sure you have seen to the tee
https://superset.apache.org/docs/installation/building-custom-viz-plugins
Here are the things I ran into when creating the chart despite following the instructions
If you normally start the superset server using docker-compose
up you will not be able to log in due to an error. However when you wish to see your custom chart you must start up the superset server first. Then you do the NPM link, then you start up the proxy and the npm run dev-server
and log in on localhost:9000
to see your plugin.
If you are on linux (ubuntu) and you have installed yarn and you get the following error doing when trying to run the command yo "ERROR: [Errno 2] No such file or directory: 'install'" to generate the hello world code sample and template for the plug in do this:
sudo apt remove yarn
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt-get update
sudo apt-get install yarn -y
This is important. Anything above
node 16.9.1
will cause compile errors. I use nvm
and set it to node 16.9.1
If you get the following error when running npm install
or npm run dev-server
Error: ENOSPC: System limit for number of file watchers reached
The resolution is: React Native Error: ENOSPC: System limit for number of file watchers reached
Had a weird problem with the npm link that seemed to go away. But if it has trouble finding the plugin even though you did everything right (and it will bomb on compile saying something like it can't find the directory) one way on linux to get around that is to do a symbolic link after doing the npn link
ln -s ../../../superset-ui/plugins/plugin-chart-hello-world
Upvotes: 1