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

Cannot import input-moment #9

Closed
arnekolja opened this issue Feb 13, 2016 · 7 comments · Fixed by #12
Closed

Cannot import input-moment #9

arnekolja opened this issue Feb 13, 2016 · 7 comments · Fixed by #12

Comments

@arnekolja
Copy link

Hi,

I am having problems importing your library.

import InputMoment from 'input-moment'

throws an unexpected token error on JSX-style html tags in your code (uncompiled JSX). When importing from the dist folder it compiles (import InputMoment from 'input-moment/dist/input-moment'), but then I get the error:

ReferenceError: Can't find variable: React | input-moment.js:1

Do you have any idea why? Is it a bug in deployment or is it just me? :-) I'm trying it on a project that works like a charm otherwise, built by a gulp build script using babelify+browserify.

@wangzuo
Copy link
Owner

wangzuo commented Feb 14, 2016

You may try babel-preset-react to use jsx with babelify.

The dist version requires window.React available.

@arnekolja
Copy link
Author

I have that already, it is the setup that is not working.
Could you provide an example that's using it?

@rskumar
Copy link

rskumar commented Mar 6, 2016

I am too getting error while importing...
ERROR in D:/[...]/~/input-moment/src/input-moment.js Module parse failed: D:\[...]\node_modules\input-moment\src\input-moment.js Line 28: Unexpected token < You may need an appropriate loader to handle this file type. | | return ( | <div className="m-input-moment"> | <div className="options"> | <button type="button" className={cx('ion-calendar im-btn', {'is-active': tab === 0})} onClick={this.handleClickTab.bind(null, 0)}> @ D:/[...]/~/input-moment/index.js 1:17-46

@crussi
Copy link

crussi commented Mar 23, 2016

Me three, I'm getting error importing ...

@Robinnnnn
Copy link

Getting the same error as @rskumar

@shashankKeshava
Copy link

Facing the same Issue

@youfoundron
Copy link

+1

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 a pull request may close this issue.

7 participants