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

   ### Bug description
   
   -- TypeScript build errors 
   232.0 ERROR in ./src/views/CustomMCP/CustomMCPView.tsx:3:10
   232.0 TS2305: Module '"@superset-ui/core"' has no exported member 'useTheme'.
   232.0     1 | // superset-frontend/src/views/CustomMCP/CustomMCPView.tsx
   232.0     2 | import React, { useState } from 'react';
   232.0   > 3 | import { useTheme } from '@superset-ui/core';
   232.0       |          ^^^^^^^^
   232.0     4 | import {
   232.0     5 |   styled,
   232.0     6 |   t,
   232.0
   232.0 ERROR in ./src/views/CustomMCP/CustomMCPView.tsx:5:3
   232.0 TS2305: Module '"@superset-ui/core"' has no exported member 'styled'.
   232.0     3 | import { useTheme } from '@superset-ui/core';
   232.0     4 | import {
   232.0   > 5 |   styled,
   232.0       |   ^^^^^^
   232.0     6 |   t,
   232.0     7 |   SupersetClient,
   232.0     8 | } from '@superset-ui/core';
   232.0
   232.0 ERROR in ./src/views/CustomMCP/CustomMCPView.tsx:10:3
   232.0 TS2305: Module '"src/components"' has no exported member 'AntdButton'.
   232.0      8 | } from '@superset-ui/core';
   232.0      9 | import {
   232.0   > 10 |   AntdButton as Button,
   232.0        |   ^^^^^^^^^^
   232.0     11 |   AntdInput as Input,
   232.0     12 |   AntdCard as Card,
   232.0     13 |   AntdAlert as Alert,
   232.0
   232.0 ERROR in ./src/views/CustomMCP/CustomMCPView.tsx:11:3
   232.0 TS2305: Module '"src/components"' has no exported member 'AntdInput'.
   232.0      9 | import {
   232.0     10 |   AntdButton as Button,
   232.0   > 11 |   AntdInput as Input,
   232.0        |   ^^^^^^^^^
   232.0     12 |   AntdCard as Card,
   232.0     13 |   AntdAlert as Alert,
   232.0     14 |   AntdSpin as Spin,
   232.0
   232.0 ERROR in ./src/views/CustomMCP/CustomMCPView.tsx:12:3
   232.0 TS2305: Module '"src/components"' has no exported member 'AntdCard'.
   232.0     10 |   AntdButton as Button,
   232.0     11 |   AntdInput as Input,
   232.0   > 12 |   AntdCard as Card,
   232.0        |   ^^^^^^^^
   232.0     13 |   AntdAlert as Alert,
   232.0     14 |   AntdSpin as Spin,
   232.0     15 |   AntdCollapse as Collapse,
   232.0
   232.0 ERROR in ./src/views/CustomMCP/CustomMCPView.tsx:13:3
   232.0 TS2305: Module '"src/components"' has no exported member 'AntdAlert'.
   232.0     11 |   AntdInput as Input,
   232.0     12 |   AntdCard as Card,
   232.0   > 13 |   AntdAlert as Alert,
   232.0        |   ^^^^^^^^^
   232.0     14 |   AntdSpin as Spin,
   232.0     15 |   AntdCollapse as Collapse,
   232.0     16 | } from 'src/components';
   232.0
   232.0 ERROR in ./src/views/CustomMCP/CustomMCPView.tsx:14:3
   232.0 TS2305: Module '"src/components"' has no exported member 'AntdSpin'.
   232.0     12 |   AntdCard as Card,
   232.0     13 |   AntdAlert as Alert,
   232.0   > 14 |   AntdSpin as Spin,
   232.0        |   ^^^^^^^^
   232.0     15 |   AntdCollapse as Collapse,
   232.0     16 | } from 'src/components';
   232.0     17 | import SubMenu from 'src/features/home/SubMenu';
   232.0
   232.0 ERROR in ./src/views/CustomMCP/CustomMCPView.tsx:14:15
   232.0 TS6133: 'Spin' is declared but its value is never read.
   232.0     12 |   AntdCard as Card,
   232.0     13 |   AntdAlert as Alert,
   232.0   > 14 |   AntdSpin as Spin,
   232.0        |               ^^^^
   232.0     15 |   AntdCollapse as Collapse,
   232.0     16 | } from 'src/components';
   232.0     17 | import SubMenu from 'src/features/home/SubMenu';
   232.0
   232.0 ERROR in ./src/views/CustomMCP/CustomMCPView.tsx:15:3
   232.0 TS2305: Module '"src/components"' has no exported member 
'AntdCollapse'.
   232.0     13 |   AntdAlert as Alert,
   232.0     14 |   AntdSpin as Spin,
   232.0   > 15 |   AntdCollapse as Collapse,
   232.0        |   ^^^^^^^^^^^^
   232.0     16 | } from 'src/components';
   232.0     17 | import SubMenu from 'src/features/home/SubMenu';
   232.0     18 |
   232.0
   232.0 ERROR in ./src/views/CustomMCP/CustomMCPView.tsx:23:8
   232.0 TS7031: Binding element 'theme' implicitly has an 'any' type.
   232.0     21 |
   232.0     22 | const StyledContainer = styled.div`
   232.0   > 23 |   ${({ theme }) => `
   232.0        |        ^^^^^
   232.0     24 |     background-color: ${theme.colors.grayscale.light5};
   232.0     25 |     min-height: 100vh;
   232.0     26 |     padding: ${theme.gridUnit * 6}px;
   232.0
   232.0 ERROR in ./src/views/CustomMCP/CustomMCPView.tsx:31:8
   232.0 TS7031: Binding element 'theme' implicitly has an 'any' type.
   232.0     29 |
   232.0     30 | const StyledCard = styled(Card)`
   232.0   > 31 |   ${({ theme }) => `
   232.0        |        ^^^^^
   232.0     32 |     margin-bottom: ${theme.gridUnit * 4}px;
   232.0     33 |     box-shadow: ${theme.colors.grayscale.light2} 0px 4px 6px;
   232.0     34 |
   232.0
   232.0 ERROR in ./src/views/CustomMCP/CustomMCPView.tsx:48:8
   232.0 TS7031: Binding element 'theme' implicitly has an 'any' type.
   232.0     46 |
   232.0     47 | const StyledTextArea = styled(TextArea)`
   232.0   > 48 |   ${({ theme }) => `
   232.0        |        ^^^^^
   232.0     49 |     font-family: ${theme.typography.families.monospace};
   232.0     50 |     font-size: ${theme.typography.sizes.s}px;
   232.0     51 |
   232.0
   232.0 ERROR in ./src/views/CustomMCP/CustomMCPView.tsx:60:8
   232.0 TS7031: Binding element 'theme' implicitly has an 'any' type.
   232.0     58 |
   232.0     59 | const StyledButton = styled(Button)`
   232.0   > 60 |   ${({ theme }) => `
   232.0        |        ^^^^^
   232.0     61 |     &.ant-btn-primary {
   232.0     62 |       background-color: ${theme.colors.primary.base};
   232.0     63 |       border-color: ${theme.colors.primary.base};
   232.0
   232.0 ERROR in ./src/views/CustomMCP/CustomMCPView.tsx:74:8
   232.0 TS7031: Binding element 'theme' implicitly has an 'any' type.
   232.0     72 |
   232.0     73 | const ResultContainer = styled.div`
   232.0   > 74 |   ${({ theme }) => `
   232.0        |        ^^^^^
   232.0     75 |     background-color: ${theme.colors.grayscale.light4};
   232.0     76 |     border: 1px solid ${theme.colors.grayscale.light2};
   232.0     77 |     border-radius: ${theme.borderRadius}px;
   232.0
   232.0 ERROR in ./src/views/CustomMCP/CustomMCPView.tsx:86:8
   232.0 TS7031: Binding element 'theme' implicitly has an 'any' type.
   232.0     84 |
   232.0     85 | const ExampleItem = styled.div`
   232.0   > 86 |   ${({ theme }) => `
   232.0        |        ^^^^^
   232.0     87 |     padding: ${theme.gridUnit * 2}px;
   232.0     88 |     margin-bottom: ${theme.gridUnit * 2}px;
   232.0     89 |     background-color: ${theme.colors.grayscale.light5};
   232.0
   232.0 ERROR in ./src/views/CustomMCP/CustomMCPView.tsx:150:19
   232.0 TS2345: Argument of type 'JsonObject' is not assignable to parameter 
of type 'SetStateAction<MCPResponse | null>'.
   232.0   Property 'success' is missing in type 'JsonObject' but required in 
type 'MCPResponse'.
   232.0     148 |       });
   232.0     149 |
   232.0   > 150 |       setResponse(result.json);
   232.0         |                   ^^^^^^^^^^^
   232.0     151 |     } catch (error: any) {
   232.0     152 |       setResponse({
   232.0     153 |         success: false,
   
   
--------------------------------------------------------------------------------------------------------
   To resolve the TypeScript build errors related to theme usage and outdated 
component wrappers, the import statements were updated as follows:
   
   Removed imports
   
   The following imports were removed because they are no longer supported or 
exported in the current Superset frontend structure:
   
   import { useTheme } from '@superset-ui/core';
   import { styled } from '@superset-ui/core';
   import { AntdButton, AntdInput, ... } from 'src/components';
   
   
   useTheme and styled are not exported from @superset-ui/core in the current 
version.
   
   The Antd* wrapper components (such as AntdButton, AntdInput, etc.) are no 
longer exported from src/components.
   
   Added imports
   
   These were replaced with direct imports from Ant Design:
   
   import { Input, Button, Card, Alert, Collapse } from 'antd';
   
   
   This change is not the best solution.  
   
   Please suggest best solution.
   
    
   
   ### Screenshots/recordings
   
   _No response_
   
   ### Superset version
   
   master / latest-dev
   
   ### Python version
   
   3.9
   
   ### Node version
   
   16
   
   ### Browser
   
   Chrome
   
   ### Additional context
   
   _No response_
   
   ### Checklist
   
   - [ ] I have searched Superset docs and Slack and didn't find a solution to 
my problem.
   - [ ] I have searched the GitHub issue tracker and didn't find a similar bug 
report.
   - [ ] 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