Reputation: 4921
So I have followed: https://preset.io/blog/2020-07-02-hello-world/ for creating a simple hello-world plugin and also followed this video: https://www.youtube.com/watch?v=f6up5x_iRbI&t=936s
It worked really smooth in there but when I try it at my end, I run into a lot of issues. I tried running it on docker as well, still it didn't work. Pypi version seems to be outdated. Here's the error i get when I try to run npm run prod
:
ERROR in ./src/visualizations/presets/MainPreset.js Module not found: Error: Can't resolve '@superset-ui/plugin-chart-hello-world' in '/home/spidey/apache_superset/superset-dev/incubator-superset/superset-frontend/src/visualizations/presets'
When I open the MainPreset.js file:
Here is how it looks:
And the bottom configuration:
Going back to superset-frontend/node-modules/@superset-ui/
I have:
When I run npm run dev-server
:
But since I am running it on Virtual Instance so I can't open up the browser and check, whereas when I try
npm run prod
the error still persists:
Upvotes: 3
Views: 2863
Reputation: 4921
Somehow npm link
doesn't seem to work. Resolved by copying the chart-plugin-hello-world
file directly to the superset-frontend/node-modules/@superset-ui/
directory. This is some issue with npm link
hope it resolves in future.
Upvotes: 1
Reputation: 614
I have a suspicion of what's happening here. Is it possible that your plugin is not in superset-frontend/package.json
?
Note that if you put your hello-world plugin in package.json, and THEN do npm install
, the npm install
won't work. It's frustrating, but you need to do these things in the correct order:
npm install
(this nukes any npm links)npm link ../../......
routinenpm run dev-server
Hope that helps, but I'll continue to try to help wherever I'm able.
Upvotes: 1