diff --git a/package.json b/package.json index 3addb9da3..2a81b0a87 100644 --- a/package.json +++ b/package.json @@ -9,6 +9,7 @@ "preview": "vite preview", "lint:fix": "eslint --fix --ext .js,.vue src" }, + "type": "module", "dependencies": { "@vue/compat": "^3.2.47", "@vuelidate/core": "^2.0.0", diff --git a/src/modules/routing/modules/flow/modules/diagram/components/opened-flow-diagram.vue b/src/modules/routing/modules/flow/modules/diagram/components/opened-flow-diagram.vue index 8ee98eac4..2db9c1524 100644 --- a/src/modules/routing/modules/flow/modules/diagram/components/opened-flow-diagram.vue +++ b/src/modules/routing/modules/flow/modules/diagram/components/opened-flow-diagram.vue @@ -52,7 +52,9 @@ export default { async initDiagram() { const flowDiagramUrl = import.meta.env.VITE_FLOW_DIAGRAM_URL; const script = document.createElement('script'); - script.src = `${flowDiagramUrl}/WtFlowDiagram.umd.min.js`; + script.type = 'module'; + script.src = `${flowDiagramUrl}/WtFlowDiagram.js`; + script.onload = () => { const params = { // if edit, restore diagram @@ -82,7 +84,7 @@ export default { }, }, }; - const WtFlowDiagram = window.WtFlowDiagram.default; + const WtFlowDiagram = window.WtFlowDiagram; this.diagram = new WtFlowDiagram('#flow-diagram', params); const onSave = async ({