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

Import emoji from 'emoji-js' #94

Closed
clemishow opened this issue Sep 11, 2017 · 7 comments
Closed

Import emoji from 'emoji-js' #94

clemishow opened this issue Sep 11, 2017 · 7 comments

Comments

@clemishow
Copy link

clemishow commented Sep 11, 2017

Hello,

I tried to import in a Angular 2 / Typescript project.

import * as emoji from 'emoji-js';

There is no error.

// console.log(emoji);
    ƒ (){

		var self = this;

		/**
		 * The set of images to use for graphical emoji.
		 *
		 * @memberof emoji
		 * @type {string}
		 */
		self.img_set = 'apple';

		/**
		 * Configuration details for d…

But when I do a emoji.init_env() for example I got this error :

TypeError: __WEBPACK_IMPORTED_MODULE_7_emoji_js__.init_env is not a function

Can you help me please ? Thank you

@iamcal
Copy link
Owner

iamcal commented Sep 11, 2017

did you create an instance of the emoji object first?

var emoji = new EmojiConvertor();

@clemishow
Copy link
Author

Yes, but with Typescript, it says immediately : Emoji Converter undefined

@nosugarsociety
Copy link

I have same situation. Tried to import 'emoji-js' and checked out emoji.js file successfully compiled to my bundle.js (using Webpack ) but EmojiConverter still not defined. Of course, I created instance of emoji object.

@ChrisOwen101
Copy link

I used this (although I'm using React) and it worked for me:
import EmojiConvertor from 'emoji-js';

@mentos1386
Copy link

i had to use import * as EmojiConvertor from 'emoji-js/lib/emoji.js'; on angular 5.

@vishnukalakota
Copy link

vishnukalakota commented Feb 2, 2018

@ChrisOwen101
import EmojiConvertor from 'emoji-js';
works only remote debugger on.
Emoji Converter undefined when disable the debugger on simulator.
any idea

@xanderberkein
Copy link

@vishnukalakota If you are using react native, this pull request will fix your problems: #106

@iamcal iamcal closed this as completed Jan 8, 2020
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

No branches or pull requests

7 participants