diff --git a/apps/vyper/src/app/app.tsx b/apps/vyper/src/app/app.tsx index f0216cb2a6..4974934198 100644 --- a/apps/vyper/src/app/app.tsx +++ b/apps/vyper/src/app/app.tsx @@ -15,6 +15,7 @@ import Button from 'react-bootstrap/Button' import './app.css' import { CustomTooltip } from '@remix-ui/helper' import { Form } from 'react-bootstrap' +import { CompileErrorCard } from './components/CompileErrorCard' interface AppState { status: 'idle' | 'inProgress' @@ -68,6 +69,9 @@ const App = () => { useEffect(() => { remixClient.eventEmitter.on('setOutput', (payload) => { + if (payload.status === 'failed') { + console.error('Error in the compiler', payload) + } setOutput(payload) }) @@ -95,6 +99,7 @@ const App = () => { setOutput(remixClient.compilerOutput) } + console.log('output', output) return (
@@ -161,7 +166,7 @@ const App = () => { <> - ) : null + ) : output.status === 'failed' ? : null } diff --git a/apps/vyper/src/app/components/CompileErrorCard.tsx b/apps/vyper/src/app/components/CompileErrorCard.tsx new file mode 100644 index 0000000000..53f2486c70 --- /dev/null +++ b/apps/vyper/src/app/components/CompileErrorCard.tsx @@ -0,0 +1,19 @@ +import Reaact from 'react' + +export function CompileErrorCard(props: any) { + return ( +
+ + + {props.output.message.trim()} + +
+ ) +} diff --git a/apps/vyper/src/app/components/VyperResult.tsx b/apps/vyper/src/app/components/VyperResult.tsx index a1f799cfb0..3234ef0cdc 100644 --- a/apps/vyper/src/app/components/VyperResult.tsx +++ b/apps/vyper/src/app/components/VyperResult.tsx @@ -59,7 +59,7 @@ function VyperResult({ output, plugin }: VyperResultProps) { return ( <>
-
+