-
-
Notifications
You must be signed in to change notification settings - Fork 37.3k
Retry on failed ICU data load, ignoring NODE_ICU_DATA or --icu-data-dir #32466
Copy link
Copy link
Closed as not planned
Closed as not planned
Copy link
Labels
cliIssues and PRs related to the Node.js command-line interface.Issues and PRs related to the Node.js command-line interface.i18n-apiIssues and PRs related to Node.js internationalization support.Issues and PRs related to Node.js internationalization support.staleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.Issues and PRs marked stale due to inactivity and scheduled for automatic closure.
Description
Activity
Metadata
Metadata
Assignees
Labels
cliIssues and PRs related to the Node.js command-line interface.Issues and PRs related to the Node.js command-line interface.i18n-apiIssues and PRs related to Node.js internationalization support.Issues and PRs related to Node.js internationalization support.staleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.Issues and PRs marked stale due to inactivity and scheduled for automatic closure.
Related to #30825 (I had the idea during its discussion) and, from the icebox, #3460
Is your feature request related to a problem? Please describe.
Currently, Node with an invalid/missing ICU data directory ( set with NODE_ICU_DATA or --icu-data-dir ) just fails.
Describe the solution you'd like
It might be possible to fall back as if the
--icu-data-dirwas not specified (or the default data dir in #30825 was not present.)As early as that error message is generated, it might be possible to call
u_cleanup()to unload ICU and then reinitialize it using the baked-in data or other defaults.This could be done completely within
InitializeICUDirectory(), although it might be advantageous to allow programmatic detection of the fact that this fallback happened. Ideas there:const char *u_getDataDirectory()via the ICU process binding.print out a warning(not a good idea)FYI @sam-github @sgallagher @nodejs/i18n-api
Describe alternatives you've considered
There's really no alternative to restarting the node process at this point.