question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Import Error with TypeScript

See original GitHub issue

Hi @jerosoler , I’m trying to implement the library and everything worked fine, so I started to make the file a Typescript file. But now I get the following error:

setup() {
    const Vue = { version: 3, h, render }
    const internalInstance = getCurrentInstance()
    return { Vue, internalInstance }
  },
....
setupEditor(){
  this.editor = new Drawflow(
    id,
    this.Vue,
    this.internalInstance.appContext.app._context,
  )
}

Expected 1 arguments, but got 3.Vetur(2554)

Is there something defined in the Drawflow constructor I’m not aware of, or do you know why this happens?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
SilasNiewierracommented, Oct 21, 2021

I “solved” the style error by importing the css in the index.html

import styleDrawflow from 'drawflow/dist/drawflow.min.css'

instead of like this:

<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/jerosoler/Drawflow/dist/drawflow.min.css">
0reactions
cihadturhancommented, Oct 25, 2021

@SilasNiewierra for the record, styles should be imported without name. import 'drawflow/dist/drawflow.min.css'

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeScript syntax error when importing - Stack Overflow
In short, I import a class named Point from the module point. The error suggests that a curly brace is wrong. The error...
Read more >
Common TypeScript module problems and how to solve them
Solution 2: Locate the module and resolve imports ; "*" value in the array means the exact name of the module, while the...
Read more >
Cannot use import statement outside a module [React ...
In this article, we talked about the SyntaxError: Cannot use import statement outside a module error in TypeScript and JavaScript. This error ......
Read more >
Documentation - Module Resolution - TypeScript
Module resolution is the process the compiler uses to figure out what an import refers to. Consider an import statement like import {...
Read more >
False errors in Typescript files, import statements are not ...
While working with Typescript I import dependencies from other files. Resharper grays them out as not used and then further in the code...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found