Skip to content
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

fix: Unable to use Toast UI via npm import (fix #61) #80

Closed
wants to merge 1 commit into from

Conversation

kidonchu
Copy link

Please check if the PR fulfills these requirements

  • It's submitted to right branch according to our branching model
  • It's right issue type on title
  • When resolving a specific issue, it's referenced in the PR's title (e.g. fix #xxx[,#xxx], where "xxx" is the issue number)
  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes/features)
  • Docs have been added/updated (for bug fixes/features)
  • It does not introduce a breaking change or has description for the breaking change

Description

When Toast UI is included in the codebase via npm,

import ImageEditor from 'npm:tui-image-editor';
import CodeSnippet from 'npm:tui-code-snippet';
import ColorPicket from 'npm:tui-color-picker';

it gave me _fabric2.default.util is undefined error. This was due to how fabric library was being imported into the tui image editor.

This PR correctly imports fabric into tui-image-editor so that the clients using tui-image-editor can reliably use the library via npm.

@seonim-ryu
Copy link
Member

Can one of the admins verify this patch?

@junghwan-park
Copy link
Member

junghwan-park commented Jan 18, 2019

@kidonchu
I've planing to update Fabric.js version to v2.6.0+ first quarter of 2019(It's an ideal plan).
Until then, you should not only install [email protected] via npm for TOAST UI Image-Editor's dependency but also use fabric/dist/fabric.require.js due to [email protected]'s module supporting file is fabric/dist/fabric.require.js.

@the0rem
Copy link

the0rem commented Sep 30, 2019

Is there any progress on this? The workaround for fabric is a definite pain point.

@coderfin
Copy link

I was able to get ToastUI Image Editor working including styles and icons using npm. In a couple of steps here is how I did it within an Angular app using npm, typescript, scss, etc.

https://gist.github.com/coderfin/103d75152f12dad8b0bda3df73189ca9

@jinwoo-kim-nhn
Copy link
Contributor

It seems to have been fixed since version 3.7.0. Close this pr.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants