Skip to content

'npm start' fails on 'Chinese datetime string error fix' in tasks/util/common.js:49 #2302

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

Closed
krassowski opened this issue Jan 27, 2018 · 1 comment · Fixed by #2304
Closed
Labels
bug something broken

Comments

@krassowski
Copy link
Contributor

Context: I tried to start working on #2286, following Contribution guideline. I have only minimal experience with npm/node but I am sure that my installation meets the recommended "node.js v6.x" version.

Related to #1630.

npm start (and specifically npm run start-test_dashboard) fails.
In short the regular expression in the following line:

date.toString().match(/\(([A-Za-z\s\u4E00-\u9FCC].*)\)/)[1]  // fix Chinese datetime string error. #1630

fails on 2018-01-27T15:15:48.956Z which is represented as Sat Jan 27 2018 14:15:48 GMT-0100 (-01) and after matching returns null.

krassowski:~/projects/plotly.js$ npm start

> plotly.js@1.33.1 start /home/krassowski/projects/plotly.js
> npm run start-test_dashboard


> plotly.js@1.33.1 start-test_dashboard /home/krassowski/projects/plotly.js
> node devtools/test_dashboard/server.js

*** Building the first bundle, this should take ~10 seconds ***

/home/krassowski/projects/plotly.js/tasks/util/common.js:48
        date.toString().match(/\(([A-Za-z\s\u4E00-\u9FCC].*)\)/)[1]  // fix Chinese datetime string error. #1630
                                                                ^

TypeError: Cannot read property '1' of null
    at Object.exports.formatTime (/home/krassowski/projects/plotly.js/tasks/util/common.js:48:65)
    at Browserify.<anonymous> (/home/krassowski/projects/plotly.js/tasks/util/watchified_bundle.js:78:36)
    at emitOne (events.js:96:13)
    at Browserify.emit (events.js:188:7)
    at DestroyableTransform.end [as _flush]

[....]

npm ERR! Linux 4.13.0-25-generic
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "start"
npm ERR! node v6.11.4
npm ERR! npm  v3.5.2
npm ERR! code ELIFECYCLE
npm ERR! plotly.js@1.33.1 start: `npm run start-test_dashboard`
npm ERR! Exit status 1
@krassowski krassowski changed the title 'npm start' fails on ;Chinese datetime string error fix' in tasks/util/common.js:49 'npm start' fails on 'Chinese datetime string error fix' in tasks/util/common.js:49 Jan 27, 2018
@alexcjohnson
Copy link
Collaborator

ugh, thanks @krassowski - I'd be in favor of just dropping timezone. @etpinard OK?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something broken
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants