Issue - I'm facing a challenge with my Angular application as I want to integrate Toast UI image editor. However, I am unsure about how to properly add the imports to app.module.ts in order to utilize it.
Despite following the npm installation instructions:
$ npm install --save tui-image-editor
the installation seemed successful with only one deprecated dependency present.
While browsing through the Toast UI documentation, I came across an image that referenced:
"import module = require('module') on importing. export = and import = require()"
Trying to implement this, I added a line to my app.module.ts file to reference the node module. However, I encountered an error stating:
This module can only be referenced with ECMAScript imports/exports by turning on the 'allowSyntheticDefaultImports' flag and referencing its default export
import * as index from 'tui-image-editor';
import * as index from 'tui-image-editor/index'; // attempted this as well
Further attempts led me to another error message: "Import assignment cannot be used when targeting ECMAScript modules. Consider using 'import * as ns from "mod"', 'import {a} from "mod"', 'import d from "mod"', or another module format instead"
import module = require('module')