question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Invalid time value Exception

See original GitHub issue

I got the exception when i opened this https://yadi.sk/d/9RC1JcPY3S2kHa xlsx document template

null: RangeError: Invalid time value
message: "Invalid time value"
stack: "RangeError: Invalid time value
    at Date.toISOString (<anonymous>)
    at module.exports._format (/var/www/wialon/agri/node_modules/exceljs/dist/es5/xlsx/xform/simple/date-xform.js:17:21)
    at module.exports.render (/var/www/wialon/agri/node_modules/exceljs/dist/es5/xlsx/xform/simple/date-xform.js:36:34)
    at module.exports.render (/var/www/wialon/agri/node_modules/exceljs/dist/es5/xlsx/xform/core/core-xform.js:64:29)
    at module.exports.toXml (/var/www/wialon/agri/node_modules/exceljs/dist/es5/xlsx/xform/base-xform.js:94:10)
    at /var/www/wialon/agri/node_modules/exceljs/dist/es5/xlsx/xlsx.js:441:28
    at new Promise (<anonymous>)
    at new Promish (/var/www/wialon/agri/node_modules/promish/lib/promish-class.js:23:9)
    at module.exports.addCore (/var/www/wialon/agri/node_modules/exceljs/dist/es5/xlsx/xlsx.js:439:12)
    at /var/www/wialon/agri/node_modules/exceljs/dist/es5/xlsx/xlsx.js:608:55
    at <anonymous>"
__proto__: Error {constructor: , name: "RangeError", message: "", …}

I did this dirty hack and now everything works fine

  this._format = options.format || function (dt) {
    try { return dt.toISOString(); }
    catch(e) { console.log(e); return '' }
  };

I don’t know why it’s happening because i’m newbee in js and don’t have enough time to understand exceljs lib at all.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:4
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
optimistexcommented, May 24, 2018

My current solution is to make a template through the google documents.

1reaction
navidshadcommented, Apr 13, 2018

I had the same problem, this error will happen when you use datejs in exceljs options.

Read more comments on GitHub >

github_iconTop Results From Across the Web

RangeError: Invalid time value - javascript - Stack Overflow
This exception occurs when the Date object contains an invalid date. new Date('undefined').toISOString(). In this example the Date object ...
Read more >
RangeError: invalid date - JavaScript - MDN Web Docs
The JavaScript exception "invalid date" occurs when a string leading to an invalid date has been provided to Date or Date.parse().
Read more >
throw out RangeError('Invalid time value') · Issue #1752 - GitHub
Expected behavior Hello, I want to use the component to select date, but it keeps throwing out Invalid time value error. No idea...
Read more >
I get an error "RangeError: Invalid time value"
I get an error "RangeError: Invalid time value". when I login to Tenable SC ... Also my server time is set just fine...
Read more >
Invalid time value for field - - Common causes and quick fixes
Invalid time value for field – – How to solve this Elasticsearch error. Opster Team. July-20, Version: 1.7-8.0. Before you ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found