fix(frontend): migrate to new wasm loading method

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
Tilman Vatteroth 2022-12-28 19:13:49 +01:00
parent bf777704a6
commit 5a36b13091
2 changed files with 1 additions and 12 deletions

View file

@ -30,15 +30,7 @@ export const GraphvizFrame: React.FC<CodeProps> = ({ code }) => {
value: graphvizImport,
error: libLoadingError,
loading: isLibLoading
} = useAsync(
async () =>
import(/* webpackChunkName: "d3-graphviz" */ '@hpcc-js/wasm')
.then((wasmPlugin) => {
wasmPlugin.wasmFolder(`${basePath}/_next/static/js`)
})
.then(() => import(/* webpackChunkName: "d3-graphviz" */ 'd3-graphviz')),
[]
)
} = useAsync(() => import(/* webpackChunkName: "d3-graphviz" */ 'd3-graphviz'), [])
const showError = useCallback((error: string) => {
if (!container.current) {