DrissiReda opened a new issue #11846:
URL: https://github.com/apache/incubator-superset/issues/11846


   I am trying to use tiles from an offline tileserver for maps instead of 
mapbox.
   
   I've tried changing the plugin @superset-ui/legacy-preset-chart-deckgl. But 
then the plugin isn't found.
   
   I've also disabled the plugin @superset-ui/legacy-plugin-map-box just in 
case it's that as well.
   
   Inside superset-frontend: I run:
   ```
   npm install
   ```
   
   No problem, everything goes:
   
   I then run:
   
   ```
   npm link ./plugins/legacy-preset-chart-deckgl 
   ```
   This path has my modified deckgl chart plugin.
   
   I finally run:
   
   ```
   npm run build
   ```
   
   I get the error:
   
   ```
   ERROR in ./src/visualizations/presets/MainPreset.js
   Module not found: Error: Can't resolve 
'@superset-ui/legacy-preset-chart-deckgl' in 
'/root/work/superset/incubator-superset/superset-frontend/src/visualizations/presets'
   
   ```
   <details>
   <summary>
   The whole output
   </summary>
   ERROR in chunk addSlice [entry]
   addSlice.8d7e36a138fea26409fa.entry.js
   
/root/work/superset/incubator-superset/superset-frontend/node_modules/thread-loader/dist/cjs.js!/root/work/superset/incubator-superset/superset-frontend/node_modules/babel-loader/lib/index.js??ref--5-1!/root/work/superset/incubator-superset/superset-frontend/node_modules/ts-loader/index.js??ref--5-2!/root/work/superset/incubator-superset/superset-frontend/src/setup/setupPlugins.ts
 0679771b1f82c6d5a0c81f94218ef1db
   Unexpected token (52:20)
   |     super({
   |       name: 'Legacy charts',
   |       presets: [new !(function webpackMissingModule() { var e = new 
Error("Cannot find module '@superset-ui/legacy-preset-chart-deckgl'"); e.code = 
'MODULE_NOT_FOUND'; throw e; }())()],
   |       plugins: [
   |       new __WEBPACK_MODULE_REFERENCE__124_64656661756c74__().configure({ 
key: 'area' }),
   
   ERROR in chunk crudViews [entry]
   crudViews.077c1a2bba108cabec92.entry.js
   
/root/work/superset/incubator-superset/superset-frontend/node_modules/thread-loader/dist/cjs.js!/root/work/superset/incubator-superset/superset-frontend/node_modules/babel-loader/lib/index.js??ref--5-1!/root/work/superset/incubator-superset/superset-frontend/node_modules/ts-loader/index.js??ref--5-2!/root/work/superset/incubator-superset/superset-frontend/src/setup/setupPlugins.ts
 0679771b1f82c6d5a0c81f94218ef1db
   Unexpected token (52:20)
   |     super({
   |       name: 'Legacy charts',
   |       presets: [new !(function webpackMissingModule() { var e = new 
Error("Cannot find module '@superset-ui/legacy-preset-chart-deckgl'"); e.code = 
'MODULE_NOT_FOUND'; throw e; }())()],
   |       plugins: [
   |       new __WEBPACK_MODULE_REFERENCE__124_64656661756c74__().configure({ 
key: 'area' }),
   
   ERROR in chunk dashboard [entry]
   dashboard.df09bfca764f5d43cf51.entry.js
   
/root/work/superset/incubator-superset/superset-frontend/node_modules/thread-loader/dist/cjs.js!/root/work/superset/incubator-superset/superset-frontend/node_modules/babel-loader/lib/index.js??ref--5-1!/root/work/superset/incubator-superset/superset-frontend/node_modules/ts-loader/index.js??ref--5-2!/root/work/superset/incubator-superset/superset-frontend/src/setup/setupPlugins.ts
 0679771b1f82c6d5a0c81f94218ef1db
   Unexpected token (52:20)
   |     super({
   |       name: 'Legacy charts',
   |       presets: [new !(function webpackMissingModule() { var e = new 
Error("Cannot find module '@superset-ui/legacy-preset-chart-deckgl'"); e.code = 
'MODULE_NOT_FOUND'; throw e; }())()],
   |       plugins: [
   |       new __WEBPACK_MODULE_REFERENCE__124_64656661756c74__().configure({ 
key: 'area' }),
   
   ERROR in chunk explore [entry]
   explore.fb84e5ba94ba22631009.entry.js
   
/root/work/superset/incubator-superset/superset-frontend/node_modules/thread-loader/dist/cjs.js!/root/work/superset/incubator-superset/superset-frontend/node_modules/babel-loader/lib/index.js??ref--5-1!/root/work/superset/incubator-superset/superset-frontend/node_modules/ts-loader/index.js??ref--5-2!/root/work/superset/incubator-superset/superset-frontend/src/setup/setupPlugins.ts
 0679771b1f82c6d5a0c81f94218ef1db
   Unexpected token (52:20)
   |     super({
   |       name: 'Legacy charts',
   |       presets: [new !(function webpackMissingModule() { var e = new 
Error("Cannot find module '@superset-ui/legacy-preset-chart-deckgl'"); e.code = 
'MODULE_NOT_FOUND'; throw e; }())()],
   |       plugins: [
   |       new __WEBPACK_MODULE_REFERENCE__124_64656661756c74__().configure({ 
key: 'area' }),
   
   </details>
   
   The change I have made is minimal, I just change this block from 
`src/utilities/Shared_DeckGL.jsx`:
   ```js
   export const mapboxStyle = {
     name: 'mapbox_style',
     config: {
       type: 'SelectControl',
       label: t('Map Style'),
       clearable: false,
       renderTrigger: true,
       choices: [
         ['mapbox://styles/mapbox/streets-v9', 'Streets'],
         ['mapbox://styles/mapbox/dark-v9', 'Dark'],
         ['mapbox://styles/mapbox/light-v9', 'Light'],
         ['mapbox://styles/mapbox/satellite-streets-v9', 'Satellite Streets'],
         ['mapbox://styles/mapbox/satellite-v9', 'Satellite'],
         ['mapbox://styles/mapbox/outdoors-v9', 'Outdoors'],
       ],
       default: 'mapbox://styles/mapbox/light-v9',
       description: t('Base layer map style'),
     },
   };
   ```
   
   With this one:
   
   ```js
   export const mapboxStyle = {
     name: 'mapbox_style',
     config: {
       type: 'TextControl',
       label: t('Map Style'),
       renderTrigger: true,
         default: 'localhost:18080/data/openmaptiles_satellite_lowres.json',
       description: t('Base layer map style'),
     },
   };
   ```


----------------------------------------------------------------
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.

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