-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Module '"tui-image-editor"' has no default export. #219
Comments
@Omaak Checkout https://github.com/nhn/tui.image-editor#typescript section. |
I am using angular4 having angular core 7.0.2 and all dependencies are looking good but not able to understand why its giving error to me. |
@Omaak it seems that the latest version is broken (3.6.1).
Same library with version 3.5.2 works. @junghwan-park, do you have any idea what the cause may be? |
@junghwan-park I have investigate and the problem is related to latest update of fabric and how transpiling with webpack. The problem is related when fabric load the buffer library |
@mrbatista |
…ion (fix #129, #134, #219) (#234) * fix: Resolve jQuery vulnerability * fix: Change fabric import method named to default & correct webpack external config (fix #129, #219) * fix: Add fabric.js to external library into karma webpack config (fix #134) * fix: Add half stroke width to center added icon's left, top
@junghwan-park issue resolved with the latest release. |
Just a note that this is still an issue in the latest release (3.7.0). And the mentioned solution of enabling esModuleInterop does work, but has some consequences. There are some problems this can cause with other modules. Currently, I'm running into bootstrap popover issues with it enabled. Like hard locking the browser rendering thread at 100% CPU kind of problems. Any way we can get a typescript-friendly solution which doesn't involve esModuleInterop being required? |
@arimus In TypeScript, you should import ImageEditor module via |
@junghwan-park Unfortunately, using import assignment like that is not an option when you are targeting ECMAScript modules in typescript. That leads to a TS1202 error. At a minimum it seems that with the latest angular stack, you have to set allowSyntheticDefaultImports to true and use the "import ImageEditor from 'tui-image-editor'" form. I'm trying to get to the root issue with that causing problems in other modules, so we'll see what I find there. update: looks like allowSyntheticDefaultImports in a clean project allows the use above and there are no oddities with locking up like I observed in a much larger project with many deps. There must be something else causing some of the issues. |
There is nothing wrong with the current state. We will reconsider the default export support for future major updates. |
The error keeps alive in the Angular version of the editor. error TS2307: Cannot find module 'toast-ui-image-editor'. I always get this error when trying to run the project. |
…ion (fix nhn#129, nhn#134, nhn#219) (nhn#234) * fix: Resolve jQuery vulnerability * fix: Change fabric import method named to default & correct webpack external config (fix nhn#129, nhn#219) * fix: Add fabric.js to external library into karma webpack config (fix nhn#134) * fix: Add half stroke width to center added icon's left, top
We have tried to integrate with TypeScript in angular. Can we export the namespace instead of This way, we can use all interfaces/types declared in this module by importing in TypeScript like import * as tuiImageEditor from 'tui-image-editor'; public imageEditor = new tuiImageEditor.ImageEditor(...); |
Version
"ngx-tui-image-editor": "^7.0.2"
"tui-image-editor": "^3.5.2"
Development Environment
"@angular/core": "~7.2.0", window 10 enterprize
Current Behavior
As I have integrated tui editor in my angular application but while building it's giving me an error
Module '"tui-image-editor"' has no default export. In your toast-tui-image-editor.component.d.ts file.
So its integration error or its bug. Help on this.
Expected Behavior
The text was updated successfully, but these errors were encountered: