Skip to main content
jk2K
New Participant
April 12, 2023
Solved

ReferenceError: 'Intl' is not defined

  • April 12, 2023
  • 2 replies
  • 1775 views

not support Intl

ReferenceError: ‘Intl’ is not defined

const formatter = new Intl.DateTimeFormat('en-US', {
  year: 'numeric',
  month: '2-digit',
  day: '2-digit',
  hour: 'numeric',
  hour12: false,
  minute: 'numeric',
  timeZone: 'Asia/Shanghai',
});
const expiredAtDate = new Date(expiredAt)
expiredAtText = formatter.format(expiredAtDate);
This topic has been closed for replies.
Best answer by stevejonn

If you are using a script file and receive the error message “Uncaught ReferenceError: Intl is not defined,” it means that ‘Intl’ is either a variable or a method that you are attempting to use before declaring it using the var keyword. This error indicates that there is a reference to a non-existent variable somewhere in the code. To fix this error, you need to declare the variable or ensure that it is available in the current script or scope. If the variable is not available, it may indicate that the library is not loaded, and JavaScript does not recognize ‘Intl’.

To solve this error: Load your library at the beginning of all your scripts.

There can be multiple other reasons for this issue:

  • Conflict with Other Libraries
  • Path to your library included is not correct
  • Llibrary file is corrupted
  • Working offline (when you use CDN)

2 replies

stevejonnAnswer
April 24, 2023

If you are using a script file and receive the error message “Uncaught ReferenceError: Intl is not defined,” it means that ‘Intl’ is either a variable or a method that you are attempting to use before declaring it using the var keyword. This error indicates that there is a reference to a non-existent variable somewhere in the code. To fix this error, you need to declare the variable or ensure that it is available in the current script or scope. If the variable is not available, it may indicate that the library is not loaded, and JavaScript does not recognize ‘Intl’.

To solve this error: Load your library at the beginning of all your scripts.

There can be multiple other reasons for this issue:

  • Conflict with Other Libraries
  • Path to your library included is not correct
  • Llibrary file is corrupted
  • Working offline (when you use CDN)
S_e_b_a_s_t_i_a_n
New Participant
November 29, 2023

I also have this problem.