How do I import various modules from the JointJS+ library? #2690
Unanswered
makleo2002
asked this question in
Q&A
Replies: 1 comment
-
Have you tried the importmap? <script type="importmap">
{
"imports": {
"@joint/plus": "../node_modules/@joint/plus/joint-plus.mjs"
}
}
</script> |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Introduction
I'm making a schematic and diagram editor. Initially, I had all the code in the form of functions in the Index.js. I decided to divide everything into classes, but there was a problem with imports.
Uncaught TypeError: The "@joint/plus" specifier was a bare specifier, but was not reassigned to anything. The associated module specifiers must start with "./", "../" or "/".
When I write the entire relative path to the joint-plus file.js, then writes Uncaught SyntaxError: The requested module 'http://127.0.0.1:5500/node_modules/@joint/plus/joint-plus.js' doesn't provide an export named: 'shapes'
How do I import the library correctly?
AbstractDiagram.js:
`import { dia, shapes, ui } from '@joint/plus';
class AbstractDiagram {
title;
graph;
paper;
paperSmall;
commandManager;
selection;
clipboard;
currentElement;
snaplines;
link;
canvas;
}
export default AbstractDiagram;
`
index.html:
`
<title>Diagram Editor</title>Steps to reproduce
No response
Restrictions & Constraints
No response
Does your question relate to JointJS or JointJS+. Select both if applicable.
JointJS+
Beta Was this translation helpful? Give feedback.
All reactions