-
Notifications
You must be signed in to change notification settings - Fork 837
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
Module 'moment' has no exported member 'MomentFormatSpecification' #343
Comments
I have the same problem. The issue is probably that the moment-timezone typescript bindings are not up to date with moment typescript bindings. |
See #341 for TBD on adding typescript bindings for moment-timezone. We'd certainly accept a pull request. |
What is pull request number? I need it for typings. |
For now a workaround that let me get past this is:
|
angular2 & typescript newb here. thanks @konrad-garus for providing that workaround. I gave that a try and it seems to install. However, I get the following run-time error so something still ain't right:
For what it's worth I'm importing it as follows (though not sure if it's right):
I've also installed the package via npm as follows:
Do I need to add it manually to system-config.ts? to main.ts? Any other ideas why it doesn't just work? thanks in advance for any wisdom you may be able to impart, |
@berkeleydiego Looking at your stacktace, the error is really a 404 on http://localhost:4200/moment-timezone. I don't know what there is in your stack, how everything is packaged and served (and it doesn't look familiar at the first glance). So I don't know the answer, the only idea is to understand what's trying to load moment-timezone from this location (maybe it shouldn't?) or how to provide it to the loader so it doesn't 404 (when it should indeed be loaded). |
I have almost the same problem:
Only in my case, the types were installed from npm |
I had problems with |
@AndreiShostik did you solve this issue? I'm facing almost the same problem installing from |
@wceolin yep, I've created custom typing file import * as moment from "moment";
declare module "moment" {
export type MomentFormatSpecification = string;
}
export = moment; you may also have to add it in |
@AndreiShostik thanks, as |
As @wceolin and @AndreiShostik I also use the import from moment-timezone
Our build is strict and thus is failing now. |
@titimoby since RC.6, I'm using |
It worked! thanks @wceolin |
@AndreiShostik This solved my issue. Checked the files source code, there isn't any type definition for Edit: The issue seems to be fixed in moment/moment@0866ff9 This issue should be closed. |
Closing since several people are saying fixed. |
I'm trying to use moment-timezone in the browser. Installed it like this using
typings 1.0.4
:The resolved
typings\globals\moment-timezone\index.ts
file ends up with these lines that is causing TS build failure:Is this a bug or am I doing something wrong?
The text was updated successfully, but these errors were encountered: