webpack: Stats: RangeError: Expected Area/Location(/Location)* for time zone, got CET

Bug report

What is the current behavior?

timeZone = CET throws RangeError.

If the current behavior is a bug, please provide the steps to reproduce.

  1. set the OS timezone to CET
  2. run webpack

Error Log:

webpack --config webpack.config.client.js

 

/var/lib/jenkins/wd/workspace/.../node_modules/webpack/lib/Stats.js:991

                               builtAtDate.toLocaleDateString(undefined, {

                                           ^

 

RangeError: Expected Area/Location(/Location)* for time zone, got CET

    at new DateTimeFormat (native)

    at Date.toLocaleDateString (native)

    at Function.jsonToString (/var/lib/jenkins/wd/workspace/.../node_modules/webpack/lib/Stats.js:991:17)

    at Stats.toString (/var/lib/jenkins/wd/workspace/.../node_modules/webpack/lib/Stats.js:859:16)

    at compilerCallback (/var/lib/jenkins/wd/workspace/.../node_modules/webpack-cli/bin/cli.js:333:32)

    at compiler.run (/var/lib/jenkins/wd/workspace/.../node_modules/webpack-cli/bin/cli.js:359:7)

    at finalCallback (/var/lib/jenkins/wd/workspace/.../node_modules/webpack/lib/Compiler.js:257:39)

    at hooks.done.callAsync.err (/var/lib/jenkins/wd/workspace/.../node_modules/webpack/lib/Compiler.js:306:14)

    at AsyncSeriesHook.eval [as callAsync] (eval at create (/var/lib/jenkins/wd/workspace/.../node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:6:1)

    at AsyncSeriesHook.lazyCompileHook (/var/lib/jenkins/wd/workspace/.../node_modules/tapable/lib/Hook.js:154:20)

    at emitRecords.err (/var/lib/jenkins/wd/workspace/.../node_modules/webpack/lib/Compiler.js:304:22)

    at Compiler.emitRecords (/var/lib/jenkins/wd/workspace/.../node_modules/webpack/lib/Compiler.js:499:39)

    at emitAssets.err (/var/lib/jenkins/wd/workspace/.../node_modules/webpack/lib/Compiler.js:298:10)

    at hooks.afterEmit.callAsync.err (/var/lib/jenkins/wd/workspace/.../node_modules/webpack/lib/Compiler.js:485:14)

    at AsyncSeriesHook.eval [as callAsync] (eval at create (/var/lib/jenkins/wd/workspace/.../node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:15:1)

    at AsyncSeriesHook.lazyCompileHook (/var/lib/jenkins/wd/workspace/.../node_modules/tapable/lib/Hook.js:154:20)

    at asyncLib.forEachLimit.err (/var/lib/jenkins/wd/workspace/.../node_modules/webpack/lib/Compiler.js:482:27)

    at /var/lib/jenkins/wd/workspace/.../node_modules/neo-async/async.js:2818:7

    at done (/var/lib/jenkins/wd/workspace/.../node_modules/neo-async/async.js:3522:9)

    at AsyncSeriesHook.eval [as callAsync] (eval at create (/var/lib/jenkins/wd/workspace/.../node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:6:1)

    at outputFileSystem.writeFile.err (/var/lib/jenkins/wd/workspace/.../node_modules/webpack/lib/Compiler.js:464:33)

    at /var/lib/jenkins/wd/workspace/.../node_modules/graceful-fs/graceful-fs.js:57:14

    at FSReqWrap.args [as oncomplete] (fs.js:140:20)

npm ERR! code ELIFECYCLE

npm ERR! errno 1

npm ERR! ui-renderer-standalone@1.5.0 build-common: `webpack --config webpack.config.client.js`

npm ERR! Exit status 1

npm ERR!

npm ERR! Failed at the ui-renderer-standalone@1.5.0 build-common script.

npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

 

npm ERR! A complete log of this run can be found in:

npm ERR!     /home/jenkins/.npm/_logs/2019-10-14T09_36_17_518Z-debug.log

npm ERR! code ELIFECYCLE

npm ERR! errno 1

npm ERR! ui-renderer-standalone@1.5.0 build: `cross-env NODE_ENV=production npm run build-common`

npm ERR! Exit status 1

npm ERR!

npm ERR! Failed at the ui-renderer-standalone@1.5.0 build script.

npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

 

npm ERR! A complete log of this run can be found in:

npm ERR!     /home/jenkins/.npm/_logs/2019-10-14T09_36_17_534Z-debug.log

Related code:

https://github.com/webpack/webpack/blob/42407cb5616aff940935cb58a4fda8429140c122/lib/Stats.js#L977-L996

Introduced here: https://github.com/webpack/webpack/commit/3d43f1e85f0e38edc62b85754b68ecfc53699ee7

What is the expected behavior?

No RangeError.

Other relevant information: webpack version: 4.41.1 Node.js version: 10.16.3 Operating System: Linux nodejs-slave-dtmhw 3.10.0-957.21.2.el7.x86_64 #1 SMP Tue May 28 09:26:43 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux Additional tools: OpenShift Jenkins NodeJs Slave

Details about the OpenShift pod:

NAME="Red Hat Enterprise Linux Server"
VERSION="7.6 (Maipo)"
ID="rhel"
ID_LIKE="fedora"
VARIANT="Server"
VARIANT_ID="server"
VERSION_ID="7.6"
PRETTY_NAME="Red Hat Enterprise Linux Server 7.6 (Maipo)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:redhat:enterprise_linux:7.6:GA:server"
HOME_URL="https://www.redhat.com/"
BUG_REPORT_URL="https://bugzilla.redhat.com/"

REDHAT_BUGZILLA_PRODUCT="Red Hat Enterprise Linux 7"
REDHAT_BUGZILLA_PRODUCT_VERSION=7.6
REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux"
REDHAT_SUPPORT_PRODUCT_VERSION="7.6"

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 3
  • Comments: 15 (8 by maintainers)

Most upvoted comments

This issue had no activity for at least three months.

It’s subject to automatic issue closing if there is no activity in the next 15 days.

PR #9821 is merged - just waiting for release

Maybe even this:

let date;
try {
  date = builtAtDate.toLocaleDateString(undefined, {
    day: "2-digit",
    month: "2-digit",
    year: "numeric",
  });
} catch(err) {
  date = builtAtDate.toLocaleDateString(undefined, {
    day: "2-digit",
    month: "2-digit",
    year: "numeric",
    timeZone: "UTC"
  });
}