pksilen opened a new issue, #33788:
URL: https://github.com/apache/superset/issues/33788

   ### Bug description
   
   I have generated a custom visualization plugin according to your 
documentation here: 
https://superset.apache.org/docs/contributing/howtos/#creating-visualization-plugins
   
   When I try to build the plugin with `npm run build`, the following problems 
occur:
   1. Compilation fails due to unused "sections" import in controlPanel.ts 
file. Commenting out that import fixes the build.
   2. Running the tests in postbuild phase fails. I was only able to run the 
tests successfully after I installed jest dom package (jest-environment-jsdom) 
and configured it in jest.config.js.
   3. Running the three tests can take relatively long time, e.g. from 30 secs 
to 1 minute.
   4. When running the tests, there are a lot of warnings on the console which 
all start with this: `*You should call configure(...) before calling other 
methods*. 
   
   Here is an example stack-trace for the warnings:
   
   ```
   18 |  */
         19 | import { t, validateNonEmpty } from '@superset-ui/core';
       > 20 | import {
            | ^
         21 |   ControlPanelConfig,
         22 |   // sections,
         23 |   sharedControls,
   
         at getInstance 
(node_modules/@superset-ui/core/lib/translation/TranslatorSingleton.js:46:13)
         at t 
(node_modules/@superset-ui/core/lib/translation/TranslatorSingleton.js:69:10)
         at Object.<anonymous> 
(node_modules/@superset-ui/chart-controls/lib/shared-controls/legacySortBy.js:32:30)
         at Object.<anonymous> 
(node_modules/@superset-ui/chart-controls/lib/index.js:95:21)
         at Object.require (src/plugin/controlPanel.ts:20:1)
         at Object.require (src/plugin/index.ts:21:1)
         at Object.require (src/index.ts:20:1)
         at Object.require (test/index.test.ts:19:1)
   ``
   
   
   ### Screenshots/recordings
   
   _No response_
   
   ### Superset version
   
   4.1.2
   
   ### Python version
   
   Not applicable
   
   ### Node version
   
   18 or greater
   
   ### Browser
   
   Not applicable
   
   ### Additional context
   
   _No response_
   
   ### Checklist
   
   - [x] I have searched Superset docs and Slack and didn't find a solution to 
my problem.
   - [x] I have searched the GitHub issue tracker and didn't find a similar bug 
report.
   - [x] I have checked Superset's logs for errors and if I found a relevant 
Python stacktrace, I included it here as text in the "additional context" 
section.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to