bunkat / later

A javascript library for defining recurring schedules and calculating future (or past) occurrences for them. Includes support for using English phrases and Cron schedules. Works in Node and in the browser.
http://bunkat.github.io/later/
MIT License
2.42k stars 244 forks source link

v1.2.0 Cannot find module './later' #153

Open ghost opened 8 years ago

ghost commented 8 years ago

I am getting this issue when trying to require later in react js like so: var later = require('later')

bunkat commented 8 years ago

Are you using webpack?

ghost commented 8 years ago

No, I'm using Meteor 1.3 to watch the code

bunkat commented 8 years ago

I don't use Meteor so I'm not sure what the problem could be.

wsun commented 8 years ago

@rravikot @bunkat not sure if it's helpful, but when I used Later with React Native 25, I found that I had to edit this in index.js to successfully import the module

require(process.env['LATER_COV'] ? "./later-cov" : "./later");

to

require("./later");

Unfortunately I'm not familiar enough with the RN packager to understand why this would make a difference...

jschlieber commented 8 years ago

Same problem here: Meteor 1.3. Added later to project with npm install --save later. Then trying to

import later from 'later';

gives: install.js:78 Uncaught Error: Cannot find module './later'

redmoses commented 8 years ago

I'm also experiencing the same problem with Meteor v1.3.2.4. Added later to project using this command

meteor npm install --save later

code:

import later from 'later';

error message: install.js:78 Uncaught Error: Cannot find module './later'

JakeHartnell commented 8 years ago

Another npm package has solved this issue: https://www.npmjs.com/package/meteor-later

It's a clone of later, but works for meteor's import keyword.

ghost commented 8 years ago

Manually add "later" : "1.2.0" to your Meteor package.json then npm install.