-
Notifications
You must be signed in to change notification settings - Fork 14.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Loading custom 'Viz' plugin #11694
Comments
Further I would like to mention that this issue is nearly the same as issue #10433 . Running I have tried every solution from this issue (copying it manually instead of npm link, deleting node_modules etc.). |
Hmmm... I haven't personally run into this, so I don't have a good answer without doing some investigation, but I'm glad the plugin process itself is working! My suspicion is that you'll have to dig into The alternative, if you have superset running for you in other circumstances, would be to go further towards production by actually |
Hello and thanks for the response. I have edited the
But when I run |
@rusackas I assumed that I would work, but it doesn't work. It does not show up in Visualizations whatever I do. Suspected problem When I run the |
Update, I have reinstalled everything, even Ubuntu server 20.04. Reinstalled Superset through this tutorial Created a plugin from scratch using the preset.io hello world tutorial, and still no result. Is there anyone who is able to help my with this issue? I want to use Superset but I cannot find a solution to this particular problem. @rusackas @mistercrunch Currently the plugin does not load inside the dev-server environment. The symlink message does appear but no plugin in my visualization list (Charts -> create new chart). When I want to run |
@robinbakkerdemcon if you want to use yarn build first you'll need to use yarn install, and maybe you'll also need npm install. I'm running in the same problem than you... Are you using docker environment? |
Yes I have done that, yarn install and npm install but sadly I am running into the same issue as before. I am not running in a docker environment. I have installed all python dependencies inside a Virtual Environment as recommended. I am sorry that you have the same problem, I tried reinstalling everything (even Ubuntu Server) and installing everything from scratch again using the guides provided by Apache Superset but it still won't work. For now I have given up on trying everything I can, but if someone is able to help me (and now you) with this problem I still want to try and get this working. |
I'm running into the same issue when adding custom plugins, I'm using docker. When I add a new custom visualization plugin using this tutorial and run docker-compose, I get this error
I can run the dev server using |
for developing a custom plugin, you'll want to use the |
@nytai Thanks for the reply, once I'm finishing developing the plugin and want to show it in prod, is that possible? Or are custom plugins limited to dev only? |
You'd have to publish the plugin as an npm package and then add it to superset. I'm not sure if we'll be merging community plugins into upstream master yet, but you can always maintain your fork with a commit that adds the custom viz plugin. Of course that means building your own custom prod version of superset from source, but you should have all the tools necessary. We have a dynamic plugin marketplace type feature in the works, but not sure when that will be coming. |
@returnzer0 the most common path for that would be to publish the package on NPM (including the built assets) from your own repo, so that you can then import the NPM module as a dependency in your Superset implementation. |
@rusackas Thank you, I have another question in hopes of not swaying away from the original issue. If I don't really care about publishing the custom viz on npm, but I simply want to create a docker-compose build which I can then host anywhere, privately, is there any way to go about it? I think that my concern and @robinbakkerdemcon are quite similar. (please correct me if they aren't) Currently, I'm just getting npm linking errors, and following #10433 doesn't get me anywhere. |
You could try building the viz plugin and installing it using the |
actually, I bet the issue with docker (via npm link) is that the linked plugin isn't in the docker file system. I'd try moving the plugin into |
Not sure I fully understood the problem, but I'd recommend try not to rely on Docker for the dev build. You may even try to start Superset with Docker, but checkout another copy of superset source code to have a clean build. The webpack dev server allows you to point to arbitrary remote host (even if it is running on a different version of Superset), so as long as you have the backend successfully running somewhere, you can always build the dev server locally to get more predictable build results.
|
Hello @returnzer0 I reach a solution with docker. I'm using a old plugin (JS instead of TS) but I think it should work.
The steps from 1-8 should be repeated when you add a new plugin, but if you are doing some changes in your plugin you can change the files in the plugin and the changes will be reflected in your instance when you restart it. I hope this works for you. I know how frustating is it, I spend 2 whole weeks to understand it. |
Thank you, everyone! It was indeed an issue with npm package linking (or lack of). I tried what @avicenteg outlined and I am able to run it with I would add that, in step 6, I didn't change anything. Instead, I went into @robinbakkerdemcon hope this also shines some light on your issue, I am able to run it via docker and expose a port on my gateway and can access it from anywhere and all of the plugins are loading just fine for me. Edit: I wanted to add that this method works for new files (typescript), and for both class and functional react components. |
I have tried publishing my npm package, adding it to package.json and adding it to ERROR in ./src/visualizations/presets/MainPreset.js
Module not found: Error: Can't resolve '@reda_drissi/legacy-preset-chart-deckgl-maptiler' in '/app/superset-frontend/src/visualizations/presets' While building the docker image with the official dockerfile. I also ran "npm install" locally to build the appropriate package-lock.json so that "npm ci" in the Dockerfile finds the right file. |
Did you try adding it via the |
@returnzer0 that's how I started, it was a local package that I tried using with |
A new guide for custom cuz plugin will be published soon after the latest monorepo changes |
Hello,
Recently I have started setting up Apache Superset and to archieve what I am looking for (a custom table view) I want to make a plugin. I have followed this tutorial (maybe 4 times) https://preset.io/blog/2020-07-02-hello-world/
When I follow this tutorial and write
npm run dev-server
it will start the dev-server at: http://localhost:9000. It perfectly loads my plugin, but the problem is that I work from home and do everything through Putty on another laptop within the company network. Now, since I work from home I want to test my plugin, how can I archieve to run the dev-server on IP '0.0.0.0'?Normally to run my superset server I write
superset run -h 0.0.0.0 -p 8088
this perfectly loads up superset and I can access it at home but this does not load the hello-world plugin!What I already tried
npm run dev-server --host 0.0.0.0
So I see two possibilities:
superset run -h 0.0.0.0 -p 8088
The text was updated successfully, but these errors were encountered: