ReferenceError: Intl is not defined

87 views Asked by At

I build a javascript runtime using v8 version 8.8 Here is my args.gn file

target_cpu = "x64"
v8_monolithic = true
v8_static_library = true
use_libfuzzer = false
v8_enable_test_features = ""
symbol_level = 0
is_component_build = false
use_sysroot = false
use_glib = false
use_custom_libcxx = false
use_custom_libcxx_for_host = false
v8_enable_i18n_support = true
v8_use_external_startup_data = false

In my cmakelists.txt i have linked the icu with my runtime also. There is no error during the cmake also and i get the log of ICU found. But still when trying to execute a script which uses a dayjs method (it needs intl support) i see the intl not defined error.

ReferenceError: Intl is not defined
    at getDateTimeFormat ([email protected]/plugin/timezone/index.js:24:5)
    at makeFormatParts ([email protected]/plugin/timezone/index.js:50:15)
    at tzOffset ([email protected]/plugin/timezone/index.js:55:24)
    at Function.d.tz ([email protected]/plugin/timezone/index.js:160:26)

Is it due to monolith or is it a linking error or error associated with the library itself?

set(CMAKE_PREFIX_PATH "{CMAKE_SOURCE_DIR}/third_party/v8/icu")

find_package(ICU REQUIRED COMPONENTS i18n uc)
if(ICU_FOUND)
    include_directories(${ICU_INCLUDE_DIRS})
    target_link_libraries(${Target_Name}  ${ICU_LIBRARIES})
    
    message(STATUS "ICU found. Version: ${ICU_VERSION}")
else()
    message(WARNING "ICU not found. Some features may be disabled.")
endif()

in my src cpp file i am initialising the icu with the function. As far i know this returns true even in case it does not find any file. I tried passing path of libicui18n.a file here too. What should be the path to the file be here should it point to the ICU folder or any subfolder/library

v8::V8::InitializeICU();

0

There are 0 answers