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

./locale not found issue #230

Closed
keshav1007 opened this issue Oct 10, 2017 · 20 comments
Closed

./locale not found issue #230

keshav1007 opened this issue Oct 10, 2017 · 20 comments

Comments

@keshav1007
Copy link

Since date picker installs moment 2.19.1 there is a known issue with ./locale not found
moment/moment#2979

So how can i avoid this?

Solution is provided for webpacks but i am not using webpack.

@vlio20
Copy link
Owner

vlio20 commented Oct 10, 2017

What type of bundling are you using?

@keshav1007
Copy link
Author

I am using angular-cli. Is that the one you are asking?

@priyanka3110
Copy link

priyanka3110 commented Oct 10, 2017

Same error if we use it in a angular cli project

Module not found: Error: Can't resolve './locale' in 'node_modules\ng2-date-picker\node_modules\moment\src\lib\locale' using the ng2-date-picker

@vlio20
Copy link
Owner

vlio20 commented Oct 10, 2017

@keshav1007, angular cli is using webpack behind the scenes. Could you please post a simple demo project?

@priyanka3110
Copy link

image

@vlio20
Copy link
Owner

vlio20 commented Oct 10, 2017

@priyanka3110, Could you please post a simple demo project?

@priyanka051222
Copy link

priyanka051222 commented Oct 10, 2017

https://github.com/sweeti270789/angular-date-picker-demo

using the ng2-date-picker which throw above error

---Priyanka

@vlio20
Copy link
Owner

vlio20 commented Oct 10, 2017

Please provide a full demo - including the ng2-date-picker module.

@priyanka3110
Copy link

its full demo using the ng2-date-picker-module installed using npm

@vlio20
Copy link
Owner

vlio20 commented Oct 10, 2017

I can't see it in https://github.com/sweeti270789/angular-date-picker-demo/blob/master/package.json (package.json).

Sorry, but it is hard for me to create demos for each issue :)

@priyanka3110
Copy link

Now you can check I forgot to save in package json, sorry,

@vlio20
Copy link
Owner

vlio20 commented Oct 10, 2017

I will. thanks!

@alvelig
Copy link

alvelig commented Oct 10, 2017

npm i -S moment@2.18.1 should help

@priyanka3110
Copy link

priyanka3110 commented Oct 11, 2017

After using moment 2.18.1 the issue is resolved

@vlio20
Copy link
Owner

vlio20 commented Oct 11, 2017

From my understanding, if you want to use a specific locale, you have to add it to your dependencies. I will add this note to the documentation.

@echerepanova
Copy link

Agreed, locally this can be fixed with a npm install moment@2.18.1. But this issue fails on our CI/CD pipelines due to the way package.json has "^2.17.1" for moment dependency.

Is there any resolution for such scenarios?

@vlio20
Copy link
Owner

vlio20 commented Oct 11, 2017

@echerepanova, sure. You need to add it to your package.json with specific version. (without ^)

@vlio20 vlio20 added this to the 2.6.0 milestone Oct 12, 2017
@vlio20
Copy link
Owner

vlio20 commented Oct 12, 2017

@priyanka3110 , I cloned your demo project. And didn't get any error :/

@vlio20
Copy link
Owner

vlio20 commented Oct 14, 2017

@priyanka3110, @keshav1007 I really want to solve this before releasing 2.6.0. I would need your help in reproducing this issue.

I tried using @priyanka3110 demo, but didn't get any error.

Could you please try to reproduce the issue in the demo page of this component? let me know if you need any help or having any question.

@vlio20 vlio20 modified the milestones: 2.6.0, 2.7.0 Oct 16, 2017
@vlio20
Copy link
Owner

vlio20 commented Oct 23, 2017

will close this for now

@vlio20 vlio20 closed this as completed Oct 23, 2017
@vlio20 vlio20 removed this from the 2.7.0 milestone Oct 23, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants