react-datepicker icon indicating copy to clipboard operation
react-datepicker copied to clipboard

This package used to work with meteor.js; it does not work anymore. It seems react-datepicker/dist/react-datepicker.css is not working anymore. Does it have something to do with bug #1882?

Open flameuzumo opened this issue 7 years ago • 1 comments

How to install in meteor: meteor npm install --save react-datepicker

Code:

`import React, { Component } from 'react' import DatePicker from "react-datepicker"; import "react-datepicker/dist/react-datepicker.css"; //This seems to be the line with a problem export default class SearchPurchaseHistory extends Component { constructor(props) { super(props); this.state = { startDate: "", endDate: "" }; this.handleChange = this.handleChange.bind(this); this.handleChange1 = this.handleChange1.bind(this); }

handleChange(date) {
	this.setState({
		startDate: date
	});
}

handleChange1(date) {
	this.setState({
		endDate: date
	});
}
render() {
	const self = this;
	//var user = this.props.user;
	
	if (Meteor.isClient) {
		Loading.halt();
	}
	return (<div>
		<header>
			<h1 class="header1">Search purchase and invoice history</h1>
		</header>
		<label class="red" id="error"></label>
		<label class="blue" id="info"></label>
		<label class="orange" id="warning"></label>
		<form class="searchPurchaseHistory" onSubmit={this.handleSubmit.bind(this)} >
			<div class="form-group">
				<label class="col-md-2 control-label stdLabel" for="startingDate">Starting date</label>
				<div class="col-md-10">
					
					<DatePicker
						selected={this.state.startDate}
						onChange={this.handleChange}
						showMonthYearPicker
						showTimeSelect
						dateFormat="Pp"
						locale="es"
					/>
				</div>
			</div>
			<div class="form-group">
				<label class="col-md-2 control-label stdLabel" for="endingDate">Ending date</label>
				<div class="col-md-10">
					
					<DatePicker
						selected={this.state.endDate}
						onChange={this.handleChange1}
					/>
				</div>
			</div>
			<div class="form-group">
				<input class="btn btn-default green-btn" type="submit" id="submit" value="Search"/>
			</div>
		</form>	
		<br/>
	</div>)
}

} `

The error I get is as below and seems to have something to do with line 4 in the code above:

` /home/2in/Meteor1.6/meteor10-Hydrate/Atrade/node_modules/react-datepicker/dist/react-datepicker.css:1 (function (exports, require, module, __filename, __dirname) { .react-datepicker-popper[data-placement^="bottom"] .react-datepicker__triangle, .react-datepicker-popper[data-placement^="top"] .react-datepicker__triangle, .react-datepicker__year-read-view--down-arrow, ^

SyntaxError: Unexpected token . at createScript (vm.js:80:10) at Object.runInThisContext (vm.js:139:10) at Module._compile (module.js:616:28) at Object.Module._extensions..js (module.js:663:10) at Module.load (module.js:565:32) at tryModuleLoad (module.js:505:12) at Function.Module._load (module.js:497:3) at Module.require (module.js:596:17) at require (internal/module.js:11:18) at npmRequire (/home/2in/Meteor1.6/meteor10-Hydrate/Atrade/.meteor/local/build/programs/server/npm-require.js:133:10) at Module.useNode (packages/modules-runtime.js:664:18) at react-datepicker.css (packages/modules.js:433:8) at fileEvaluate (packages/modules-runtime.js:336:7) at Module.require (packages/modules-runtime.js:238:14) at Module.moduleLink [as link] (/home/2in/.meteor/packages/modules/.0.13.0.ibssab.6e4t++os+web.browser+web.browser.legacy+web.cordova/npm/node_modules/reify/lib/runtime/index.js:38:38) at SearchPurchaseHistory.jsx (imports/ui/components/SearchPurchaseHistory.jsx:1:226) at fileEvaluate (packages/modules-runtime.js:336:7) at Module.require (packages/modules-runtime.js:238:14) at Module.moduleLink [as link] (/home/2in/.meteor/packages/modules/.0.13.0.ibssab.6e4t++os+web.browser+web.browser.legacy+web.cordova/npm/node_modules/reify/lib/runtime/index.js:38:38) at router.jsx (imports/ui/router.jsx:1:8256) at fileEvaluate (packages/modules-runtime.js:336:7) at Module.require (packages/modules-runtime.js:238:14) Exited with code: 1 Your application is crashing. Waiting for file change. `

Please help.

flameuzumo avatar Sep 10 '19 11:09 flameuzumo

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Mar 08 '20 11:03 stale[bot]