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

dependencies? #9

Closed
johhansantana opened this issue Sep 4, 2018 · 2 comments
Closed

dependencies? #9

johhansantana opened this issue Sep 4, 2018 · 2 comments

Comments

@johhansantana
Copy link

I'm getting errors while trying to use Textbox.

First I got

* classnames in ./node_modules/react-inputs-validation/lib/components/Radiobox.js, ./node_modules/react-inputs-validation/lib/components/Textarea.js and 3 others

I installed classnames library and now I get:

Error in ./lib/react-inputs-validation.min.css
Module parse failed: Unexpected token (1:81) You may need an appropriate loader to handle this file type.

I'm using NextJS for this:

<Textbox
  placeholder="John Doe"
  classNameInput="input"
  type="text"
  id="name"
  maxLength="10"
/>
@edwardfxiao
Copy link
Owner

edwardfxiao commented Sep 4, 2018

Hi, thank you for your feedback. Try version 1.1.4

npm i react-inputs-validation@1.1.4 --save

Now you will need to import the css file manually since I separated them.

I have tested it in a nextjs with the latest verison.

import { Textbox } from 'react-inputs-validation';
import 'react-inputs-validation/lib/react-inputs-validation.min.css';
...
<Textbox placeholder="John Doe" classNameInput="input" type="text" id="name" maxLength="10" />
//package.json
{
  "version": "1.0.0",
  "scripts": {
    "dev": "next",
    "build": "next build",
    "start": "next start"
  },
  "dependencies": {
    "classnames": "^2.2.6",
    "react-inputs-validation": "^1.1.4",
    "@zeit/next-css": "0.2.1-canary.2",
    "next": "7.0.0-canary.3",
    "react": "16.4.2",
    "react-dom": "16.4.2"
  },
  "license": "ISC"
}
//next.config.js
const withCSS = require('@zeit/next-css');
module.exports = withCSS();

@johhansantana
Copy link
Author

Thanks!

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

2 participants