From d5486e5b9a03cae65ca15e7b13f260391147c9d7 Mon Sep 17 00:00:00 2001 From: Raymond Date: Sat, 9 Nov 2019 22:04:38 +0100 Subject: [PATCH] Add full-icu package (#9286) As long as node does not ship with fill-icu this will do the trick making FormattedRelativeTime work on nodejs. Other polyfill like @formatjs/intl-relativetimeformat/polyfill did not work on nodejs and thus giving an error that client did not match server. --- examples/with-react-intl/package.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/examples/with-react-intl/package.json b/examples/with-react-intl/package.json index 891eae60ba..ff370c0f20 100644 --- a/examples/with-react-intl/package.json +++ b/examples/with-react-intl/package.json @@ -2,15 +2,16 @@ "name": "with-react-intl", "version": "1.0.0", "scripts": { - "dev": "node server.js", + "dev": "node --icu-data-dir=node_modules/full-icu server.js", "build": "next build && node ./scripts/default-lang", - "start": "NODE_ENV=production node server.js" + "start": "NODE_ENV=production node --icu-data-dir=node_modules/full-icu server.js" }, "dependencies": { "@formatjs/intl-relativetimeformat": "^2.8.2", "@formatjs/intl-utils": "^0.6.1", "accepts": "^1.3.7", "babel-plugin-react-intl": "^4.1.14", + "full-icu": "^1.3.0", "glob": "^7.1.4", "intl": "^1.2.5", "next": "latest", -- GitLab