Skip to main content
Solved

ReferenceError: 'Intl' is not defined


jk2K
  • New Participant
  • 14 replies

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);

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)
View original

2 replies

  • 1 reply
  • Answer
  • 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

I also have this problem.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings