Skip to content
This repository has been archived by the owner on Jan 7, 2022. It is now read-only.

Error in page after pack files #18

Closed
lwenn opened this issue Nov 22, 2017 · 12 comments
Closed

Error in page after pack files #18

lwenn opened this issue Nov 22, 2017 · 12 comments
Assignees
Labels

Comments

@lwenn
Copy link

lwenn commented Nov 22, 2017

Hi, I use vue-datetime and moment in my project, and I change the attribute locale of the datetime component to value zh-cn, then it's ok when I run in npm run dev. However, I pack all files by npm run build and open the page, there is error like this when click the datetime DOM:

TypeError: Cannot read property 'weekdaysMin' of null
at Object.r [as weekdays] (index.js:formatted:13497)
at s.weekdays (index.js:formatted:13497)
at fs.get (index.js:formatted:13497)
at fs.evaluate (index.js:formatted:13497)
at s.weekdays (index.js:formatted:3642)
at s.render (index.js:formatted:13497)
at s.e._render (index.js:formatted:13497)
at s.r (index.js:formatted:3480)
at fs.get (index.js:formatted:13497)
at fs.run (index.js:formatted:13497)

Would you help to check what wrong? Thank you.

@mariomka
Copy link
Owner

Can you provide a reproduction? A small project in a repository or something similar...

@lwenn
Copy link
Author

lwenn commented Nov 27, 2017

Hi, I find the version I used is 0.5.2, then I update to 0.6.0, and there is no error using locale, and the same error using moment-locale, and setting locale doesn't work? You could see my reproduction in vue-datetime-sample, it may provide help. You could read the README.md.

@mariomka
Copy link
Owner

mariomka commented Dec 2, 2017

locale property was renamed by moment-locale.

About the error, it seems that UglifyJsPlugin is breaking something, I'm trying to found a solution.

@mariomka mariomka self-assigned this Dec 2, 2017
@shanjixiaboss
Copy link

I can't use it after build

@art0s
Copy link

art0s commented Dec 7, 2017

Hello!
I confirm this error in 0.7.0 version
after "npm run build" command
appears error:

image

in 0.5.3 everything is clean

@cruonline
Copy link

Hey guys, any progress?

I'm also trying to locate exact problem.
I can confirm, it is UglifyJsPlugin cousing this only while using locale or moment-locale prop.
So it's clearly connected to moment.js

Did anyone tried to switch moment version or other tricks that may help patching this.?

@art0s
Copy link

art0s commented Dec 16, 2017

we waiting component's update ))
#28

@cruonline
Copy link

cruonline commented Dec 17, 2017

If anyone needs fast and dirty fix, just set keep_fargs to false in uglifyjs options. Works fo me.

*EDITED, set to false, not true...

@shanjixiaboss
Copy link

@cruonline sure? but that's default is true, i just used default lang then build all right

@cruonline
Copy link

sorry, meant set to false. Sorry for confusion. This happens if you try to do mulitask and are not a cyborg ;-)

@shanjixiaboss
Copy link

Oh, no, it's my mistake. I should go to the eye department. /laugh

@mariomka
Copy link
Owner

Next version is near to be stable but changes are meaningful (see #28) but this error mustn't appear more.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

5 participants