tdlib / td

Cross-platform library for building Telegram clients
https://core.telegram.org/tdlib
Boost Software License 1.0
7.07k stars 1.44k forks source link

tdweb for browser #3085

Open B0yma opened 4 days ago

B0yma commented 4 days ago

I am trying to build tdweb for the browser and following the instructions from ReadMe at https://github.com/tdlib/td/tree/master/example/web.

When I try to run ./build-tdlib.sh step I get the following error:

-- Found ccache
-- Found OpenSSL: /mnt/c/Users/Magz/Desktop/tdlib/example/web/build/crypto/include /mnt/c/Users/Magz/Desktop/tdlib/example/web/build/crypto/lib/libssl.a;/mnt/c/Users/Magz/Desktop/tdlib/example/web/build/crypto/lib/libcrypto.a
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Check if compiler accepts -pthread
-- Check if compiler accepts -pthread - no
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - not found
CMake Error at /usr/local/share/cmake-3.29/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find Threads (missing: Threads_FOUND)
Call Stack (most recent call first):
  /usr/local/share/cmake-3.29/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)
  /usr/local/share/cmake-3.29/Modules/FindThreads.cmake:226 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  CMakeLists.txt:131 (find_package)

after delete strings in CMakerLists.txt

set(CMAKE_THREAD_PREFER_PTHREAD ON)
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)

if (THREADS_HAVE_PTHREAD_ARG)
  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread")
endif()

When I try to run ./build-tdlib.sh step I get the following error:

CMake Error at CMake/TdSetUpCompiler.cmake:42 (message):
  No C++14 support in the compiler.  Please upgrade the compiler.
Call Stack (most recent call first):
  CMakeLists.txt:132 (td_set_up_compiler)

logs1

./build-tdlib.sh
CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
  Compatibility with CMake < 3.5 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.

-- The CXX compiler identification is GNU 11.4.0
-- The C compiler identification is GNU 11.4.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Found ccache
-- Performing Test HAVE_STD14
-- Performing Test HAVE_STD14 - Success
-- Performing Test HAVE_CXX_FLAG_WALL
-- Performing Test HAVE_CXX_FLAG_WALL - Success
-- Performing Test HAVE_CXX_FLAG_WEXTRA
-- Performing Test HAVE_CXX_FLAG_WEXTRA - Success
-- Performing Test HAVE_CXX_FLAG_WIMPLICIT_FALLTHROUGH_2
-- Performing Test HAVE_CXX_FLAG_WIMPLICIT_FALLTHROUGH_2 - Success
-- Performing Test HAVE_CXX_FLAG_WPOINTER_ARITH
-- Performing Test HAVE_CXX_FLAG_WPOINTER_ARITH - Success
-- Performing Test HAVE_CXX_FLAG_WCAST_QUAL
-- Performing Test HAVE_CXX_FLAG_WCAST_QUAL - Success
-- Performing Test HAVE_CXX_FLAG_WSIGN_COMPARE
-- Performing Test HAVE_CXX_FLAG_WSIGN_COMPARE - Success
-- Performing Test HAVE_CXX_FLAG_WDUPLICATED_BRANCHES
-- Performing Test HAVE_CXX_FLAG_WDUPLICATED_BRANCHES - Success
-- Performing Test HAVE_CXX_FLAG_WDUPLICATED_COND
-- Performing Test HAVE_CXX_FLAG_WDUPLICATED_COND - Success
-- Performing Test HAVE_CXX_FLAG_WALLOC_ZERO
-- Performing Test HAVE_CXX_FLAG_WALLOC_ZERO - Success
-- Performing Test HAVE_CXX_FLAG_WLOGICAL_OP
-- Performing Test HAVE_CXX_FLAG_WLOGICAL_OP - Success
-- Performing Test HAVE_CXX_FLAG_WTAUTOLOGICAL_COMPARE
-- Performing Test HAVE_CXX_FLAG_WTAUTOLOGICAL_COMPARE - Success
-- Performing Test HAVE_CXX_FLAG_WVLA
-- Performing Test HAVE_CXX_FLAG_WVLA - Success
-- Performing Test HAVE_CXX_FLAG_WNON_VIRTUAL_DTOR
-- Performing Test HAVE_CXX_FLAG_WNON_VIRTUAL_DTOR - Success
-- Performing Test HAVE_CXX_FLAG_WUNUSED_PARAMETER
-- Performing Test HAVE_CXX_FLAG_WUNUSED_PARAMETER - Success
-- Performing Test HAVE_CXX_FLAG_WCONVERSION
-- Performing Test HAVE_CXX_FLAG_WCONVERSION - Success
-- Performing Test HAVE_CXX_FLAG_WSIGN_CONVERSION
-- Performing Test HAVE_CXX_FLAG_WSIGN_CONVERSION - Success
-- Performing Test HAVE_CXX_FLAG_WCXX14_COMPAT_PEDANTIC
-- Performing Test HAVE_CXX_FLAG_WCXX14_COMPAT_PEDANTIC - Failed
-- Performing Test HAVE_CXX_FLAG_WDEPRECATED
-- Performing Test HAVE_CXX_FLAG_WDEPRECATED - Success
-- Performing Test HAVE_CXX_FLAG_WUNUSED_COMMAND_LINE_ARGUMENT
-- Performing Test HAVE_CXX_FLAG_WUNUSED_COMMAND_LINE_ARGUMENT - Failed
-- Performing Test HAVE_CXX_FLAG_QUNUSED_ARGUMENTS
-- Performing Test HAVE_CXX_FLAG_QUNUSED_ARGUMENTS - Failed
-- Performing Test HAVE_CXX_FLAG_WUNKNOWN_WARNING_OPTION
-- Performing Test HAVE_CXX_FLAG_WUNKNOWN_WARNING_OPTION - Failed
-- Performing Test HAVE_CXX_FLAG_WODR
-- Performing Test HAVE_CXX_FLAG_WODR - Success
-- Performing Test HAVE_CXX_FLAG_FLTO_ODR_TYPE_MERGING
-- Performing Test HAVE_CXX_FLAG_FLTO_ODR_TYPE_MERGING - Success
-- Performing Test HAVE_CXX_FLAG_WPSABI
-- Performing Test HAVE_CXX_FLAG_WPSABI - Success
-- Performing Test HAVE_CXX_FLAG_WUNUSED_MEMBER_FUNCTION
-- Performing Test HAVE_CXX_FLAG_WUNUSED_MEMBER_FUNCTION - Failed
-- Performing Test HAVE_CXX_FLAG_WUNUSED_PRIVATE_FIELD
-- Performing Test HAVE_CXX_FLAG_WUNUSED_PRIVATE_FIELD - Failed
-- Performing Test HAVE_CXX_FLAG_WMAYBE_UNINITIALIZED
-- Performing Test HAVE_CXX_FLAG_WMAYBE_UNINITIALIZED - Success
-- Performing Test HAVE_CXX_FLAG_WREDUNDANT_MOVE
-- Performing Test HAVE_CXX_FLAG_WREDUNDANT_MOVE - Success
-- Performing Test HAVE_CXX_FLAG_WBIDI_CHARS_NONE
-- Performing Test HAVE_CXX_FLAG_WBIDI_CHARS_NONE - Failed
-- Git state: GITDIR-NOTFOUND
-- Performing Test ATOMICS_FOUND
-- Performing Test ATOMICS_FOUND - Success
CMake Deprecation Warning at td/generate/tl-parser/CMakeLists.txt:1 (cmake_minimum_required):
  Compatibility with CMake < 3.5 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.

-- Configuring done (15.0s)
-- Generating done (1.2s)
-- Build files have been written to: /mnt/c/Users/Magz/Desktop/tdlib/example/web/build/generate
configure: cmake -DCMAKE_BUILD_TYPE=MinSizeRel -DOPENSSL_FOUND=1 -DOPENSSL_ROOT_DIR=/mnt/c/Users/Magz/Desktop/tdlib/example/web/build/crypto -DOPENSSL_INCLUDE_DIR=/mnt/c/Users/Magz/Desktop/tdlib/example/web/build/crypto/include -DOPENSSL_CRYPTO_LIBRARY=/mnt/c/Users/Magz/Desktop/tdlib/example/web/build/crypto/lib/libcrypto.a -DOPENSSL_SSL_LIBRARY=/mnt/c/Users/Magz/Desktop/tdlib/example/web/build/crypto/lib/libssl.a -DOPENSSL_LIBRARIES=/mnt/c/Users/Magz/Desktop/tdlib/example/web/build/crypto/lib/libssl.a;/mnt/c/Users/Magz/Desktop/tdlib/example/web/build/crypto/lib/libcrypto.a -DOPENSSL_VERSION=1.1.0l /mnt/c/Users/Magz/Desktop/tdlib -DCMAKE_TOOLCHAIN_FILE=/usr/share/emscripten/cmake/Modules/Platform/Emscripten.cmake -DCMAKE_CROSSCOMPILING_EMULATOR=/usr/bin/node;--experimental-wasm-threads
CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
  Compatibility with CMake < 3.5 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.

-- Found ccache
-- Found OpenSSL: /mnt/c/Users/Magz/Desktop/tdlib/example/web/build/crypto/include /mnt/c/Users/Magz/Desktop/tdlib/example/web/build/crypto/lib/libssl.a;/mnt/c/Users/Magz/Desktop/tdlib/example/web/build/crypto/lib/libcrypto.a
-- Performing Test HAVE_STD14
-- Performing Test HAVE_STD14 - Failed
-- Performing Test HAVE_STD1Y
-- Performing Test HAVE_STD1Y - Failed
CMake Error at CMake/TdSetUpCompiler.cmake:42 (message):
  No C++14 support in the compiler.  Please upgrade the compiler.
Call Stack (most recent call first):
  CMakeLists.txt:132 (td_set_up_compiler)

-- Configuring incomplete, errors occurred!
emcmake: error: 'cmake -DCMAKE_BUILD_TYPE=MinSizeRel -DOPENSSL_FOUND=1 -DOPENSSL_ROOT_DIR=/mnt/c/Users/Magz/Desktop/tdlib/example/web/build/crypto -DOPENSSL_INCLUDE_DIR=/mnt/c/Users/Magz/Desktop/tdlib/example/web/build/crypto/include -DOPENSSL_CRYPTO_LIBRARY=/mnt/c/Users/Magz/Desktop/tdlib/example/web/build/crypto/lib/libcrypto.a -DOPENSSL_SSL_LIBRARY=/mnt/c/Users/Magz/Desktop/tdlib/example/web/build/crypto/lib/libssl.a -DOPENSSL_LIBRARIES=/mnt/c/Users/Magz/Desktop/tdlib/example/web/build/crypto/lib/libssl.a;/mnt/c/Users/Magz/Desktop/tdlib/example/web/build/crypto/lib/libcrypto.a -DOPENSSL_VERSION=1.1.0l /mnt/c/Users/Magz/Desktop/tdlib -DCMAKE_TOOLCHAIN_FILE=/usr/share/emscripten/cmake/Modules/Platform/Emscripten.cmake -DCMAKE_CROSSCOMPILING_EMULATOR=/usr/bin/node;--experimental-wasm-threads' failed (returned 1)

logs after command - export CXX="clang++-14" && export CC="clang-14"

./build-tdlib.sh
CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
  Compatibility with CMake < 3.5 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.

-- The CXX compiler identification is Clang 14.0.0
-- The C compiler identification is Clang 14.0.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/clang++-14 - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/clang-14 - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Found ccache
-- Performing Test HAVE_STD14
-- Performing Test HAVE_STD14 - Success
-- Performing Test HAVE_CXX_FLAG_WALL
-- Performing Test HAVE_CXX_FLAG_WALL - Success
-- Performing Test HAVE_CXX_FLAG_WEXTRA
-- Performing Test HAVE_CXX_FLAG_WEXTRA - Success
-- Performing Test HAVE_CXX_FLAG_WIMPLICIT_FALLTHROUGH_2
-- Performing Test HAVE_CXX_FLAG_WIMPLICIT_FALLTHROUGH_2 - Failed
-- Performing Test HAVE_CXX_FLAG_WPOINTER_ARITH
-- Performing Test HAVE_CXX_FLAG_WPOINTER_ARITH - Success
-- Performing Test HAVE_CXX_FLAG_WCAST_QUAL
-- Performing Test HAVE_CXX_FLAG_WCAST_QUAL - Success
-- Performing Test HAVE_CXX_FLAG_WSIGN_COMPARE
-- Performing Test HAVE_CXX_FLAG_WSIGN_COMPARE - Success
-- Performing Test HAVE_CXX_FLAG_WDUPLICATED_BRANCHES
-- Performing Test HAVE_CXX_FLAG_WDUPLICATED_BRANCHES - Failed
-- Performing Test HAVE_CXX_FLAG_WDUPLICATED_COND
-- Performing Test HAVE_CXX_FLAG_WDUPLICATED_COND - Failed
-- Performing Test HAVE_CXX_FLAG_WALLOC_ZERO
-- Performing Test HAVE_CXX_FLAG_WALLOC_ZERO - Failed
-- Performing Test HAVE_CXX_FLAG_WLOGICAL_OP
-- Performing Test HAVE_CXX_FLAG_WLOGICAL_OP - Failed
-- Performing Test HAVE_CXX_FLAG_WTAUTOLOGICAL_COMPARE
-- Performing Test HAVE_CXX_FLAG_WTAUTOLOGICAL_COMPARE - Success
-- Performing Test HAVE_CXX_FLAG_WVLA
-- Performing Test HAVE_CXX_FLAG_WVLA - Success
-- Performing Test HAVE_CXX_FLAG_WNON_VIRTUAL_DTOR
-- Performing Test HAVE_CXX_FLAG_WNON_VIRTUAL_DTOR - Success
-- Performing Test HAVE_CXX_FLAG_WUNUSED_PARAMETER
-- Performing Test HAVE_CXX_FLAG_WUNUSED_PARAMETER - Success
-- Performing Test HAVE_CXX_FLAG_WCONVERSION
-- Performing Test HAVE_CXX_FLAG_WCONVERSION - Success
-- Performing Test HAVE_CXX_FLAG_WSIGN_CONVERSION
-- Performing Test HAVE_CXX_FLAG_WSIGN_CONVERSION - Success
-- Performing Test HAVE_CXX_FLAG_WCXX14_COMPAT_PEDANTIC
-- Performing Test HAVE_CXX_FLAG_WCXX14_COMPAT_PEDANTIC - Success
-- Performing Test HAVE_CXX_FLAG_WDEPRECATED
-- Performing Test HAVE_CXX_FLAG_WDEPRECATED - Success
-- Performing Test HAVE_CXX_FLAG_WUNUSED_COMMAND_LINE_ARGUMENT
-- Performing Test HAVE_CXX_FLAG_WUNUSED_COMMAND_LINE_ARGUMENT - Success
-- Performing Test HAVE_CXX_FLAG_QUNUSED_ARGUMENTS
-- Performing Test HAVE_CXX_FLAG_QUNUSED_ARGUMENTS - Success
-- Performing Test HAVE_CXX_FLAG_WUNKNOWN_WARNING_OPTION
-- Performing Test HAVE_CXX_FLAG_WUNKNOWN_WARNING_OPTION - Success
-- Performing Test HAVE_CXX_FLAG_WODR
-- Performing Test HAVE_CXX_FLAG_WODR - Success
-- Performing Test HAVE_CXX_FLAG_FLTO_ODR_TYPE_MERGING
-- Performing Test HAVE_CXX_FLAG_FLTO_ODR_TYPE_MERGING - Failed
-- Performing Test HAVE_CXX_FLAG_WPSABI
-- Performing Test HAVE_CXX_FLAG_WPSABI - Success
-- Performing Test HAVE_CXX_FLAG_WUNUSED_MEMBER_FUNCTION
-- Performing Test HAVE_CXX_FLAG_WUNUSED_MEMBER_FUNCTION - Success
-- Performing Test HAVE_CXX_FLAG_WUNUSED_PRIVATE_FIELD
-- Performing Test HAVE_CXX_FLAG_WUNUSED_PRIVATE_FIELD - Success
-- Git state: GITDIR-NOTFOUND
-- Performing Test ATOMICS_FOUND
-- Performing Test ATOMICS_FOUND - Success
CMake Deprecation Warning at td/generate/tl-parser/CMakeLists.txt:1 (cmake_minimum_required):
  Compatibility with CMake < 3.5 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.

-- Configuring done (18.2s)
-- Generating done (1.3s)
-- Build files have been written to: /mnt/c/Users/Magz/Desktop/tdlib/example/web/build/generate
configure: cmake -DCMAKE_BUILD_TYPE=MinSizeRel -DOPENSSL_FOUND=1 -DOPENSSL_ROOT_DIR=/mnt/c/Users/Magz/Desktop/tdlib/example/web/build/crypto -DOPENSSL_INCLUDE_DIR=/mnt/c/Users/Magz/Desktop/tdlib/example/web/build/crypto/include -DOPENSSL_CRYPTO_LIBRARY=/mnt/c/Users/Magz/Desktop/tdlib/example/web/build/crypto/lib/libcrypto.a -DOPENSSL_SSL_LIBRARY=/mnt/c/Users/Magz/Desktop/tdlib/example/web/build/crypto/lib/libssl.a -DOPENSSL_LIBRARIES=/mnt/c/Users/Magz/Desktop/tdlib/example/web/build/crypto/lib/libssl.a;/mnt/c/Users/Magz/Desktop/tdlib/example/web/build/crypto/lib/libcrypto.a -DOPENSSL_VERSION=1.1.0l /mnt/c/Users/Magz/Desktop/tdlib -DCMAKE_TOOLCHAIN_FILE=/usr/share/emscripten/cmake/Modules/Platform/Emscripten.cmake -DCMAKE_CROSSCOMPILING_EMULATOR=/usr/bin/node;--experimental-wasm-threads
CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
  Compatibility with CMake < 3.5 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.

-- Found ccache
-- Found OpenSSL: /mnt/c/Users/Magz/Desktop/tdlib/example/web/build/crypto/include /mnt/c/Users/Magz/Desktop/tdlib/example/web/build/crypto/lib/libssl.a;/mnt/c/Users/Magz/Desktop/tdlib/example/web/build/crypto/lib/libcrypto.a
-- Performing Test HAVE_STD14
-- Performing Test HAVE_STD14 - Failed
-- Performing Test HAVE_STD1Y
-- Performing Test HAVE_STD1Y - Failed
CMake Error at CMake/TdSetUpCompiler.cmake:42 (message):
  No C++14 support in the compiler.  Please upgrade the compiler.
Call Stack (most recent call first):
  CMakeLists.txt:132 (td_set_up_compiler)

-- Configuring incomplete, errors occurred!
emcmake: error: 'cmake -DCMAKE_BUILD_TYPE=MinSizeRel -DOPENSSL_FOUND=1 -DOPENSSL_ROOT_DIR=/mnt/c/Users/Magz/Desktop/tdlib/example/web/build/crypto -DOPENSSL_INCLUDE_DIR=/mnt/c/Users/Magz/Desktop/tdlib/example/web/build/crypto/include -DOPENSSL_CRYPTO_LIBRARY=/mnt/c/Users/Magz/Desktop/tdlib/example/web/build/crypto/lib/libcrypto.a -DOPENSSL_SSL_LIBRARY=/mnt/c/Users/Magz/Desktop/tdlib/example/web/build/crypto/lib/libssl.a -DOPENSSL_LIBRARIES=/mnt/c/Users/Magz/Desktop/tdlib/example/web/build/crypto/lib/libssl.a;/mnt/c/Users/Magz/Desktop/tdlib/example/web/build/crypto/lib/libcrypto.a -DOPENSSL_VERSION=1.1.0l /mnt/c/Users/Magz/Desktop/tdlib -DCMAKE_TOOLCHAIN_FILE=/usr/share/emscripten/cmake/Modules/Platform/Emscripten.cmake -DCMAKE_CROSSCOMPILING_EMULATOR=/usr/bin/node;--experimental-wasm-threads' failed (returned 1)

Can you please help me with the error? I have wsl ubuntu Ubuntu 22.04.5 LTS Thanks

levlam commented 4 days ago

Which version of emsdk is installed? Was it installed inside WSL?

B0yma commented 4 days ago

Which version of emsdk is installed? Was it installed inside WSL?

@levlam yes inside WSL by command - sudo apt install emscripten emscripten is already the newest version (3.1.5~dfsg-3ubuntu1).

levlam commented 4 days ago

It is better to follow README (https://github.com/tdlib/td/tree/master/example/web#building-tdweb-npm-package) and manually download emsdk. Also, make sure that you completed other steps from README, namely, called source ./emsdk_env.sh before running other scripts.

B0yma commented 4 days ago

It is better to follow README (https://github.com/tdlib/td/tree/master/example/web#building-tdweb-npm-package) and manually download emsdk. Also, make sure that you completed other steps from README, namely, called source ./emsdk_env.sh before running other scripts.

thanks, with git version compile done

but now on command

./copy-tdlib.sh

there is error:

cp: cannot stat 'build/asmjs/td_asmjs.js.mem': No such file or directory

in dir after this - tdweb\src\prebuilt\release - there are 3 files: td_asmjs.js, td_wasm.js, td_wasm.wasm

after manual copy td_asmjs.js -> td_asmjs.js.mem and command

./build-tdweb.sh

getting this error:

ERROR in ./src/prebuilt/release/td_wasm.js 3:76
    Module parse failed: Unexpected token (3:76)
    You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
    |
    | var createTdwebModule = (() => {
    >   var _scriptName = typeof document != 'undefined' ? document.currentScript?.src : undefined;
    |   if (typeof __filename != 'undefined') _scriptName = _scriptName || __filename;
    |   return (
     @ ./src/worker.js (./node_modules/babel-loader/lib!./node_modules/eslint-loader!./src/worker.js) 272:19-58
after resinstall npm in emsdk env:

this[kHandle] = new _Hash(algorithm, xofLen); ^

Error: error:0308010C:digital envelope routines::unsupported at new Hash (node:internal/crypto/hash:69:19) at Object.createHash (node:crypto:133:10) at module.exports (/mnt/c/Users/Magz/Desktop/tdlib/example/web/tdweb/node_modules/webpack/lib/util/createHash.js:135:53) at NormalModule._initBuildHash (/mnt/c/Users/Magz/Desktop/tdlib/example/web/tdweb/node_modules/webpack/lib/NormalModule.js:417:16) at handleParseError (/mnt/c/Users/Magz/Desktop/tdlib/example/web/tdweb/node_modules/webpack/lib/NormalModule.js:471:10) at /mnt/c/Users/Magz/Desktop/tdlib/example/web/tdweb/node_modules/webpack/lib/NormalModule.js:503:5 at /mnt/c/Users/Magz/Desktop/tdlib/example/web/tdweb/node_modules/webpack/lib/NormalModule.js:358:12 at /mnt/c/Users/Magz/Desktop/tdlib/example/web/tdweb/node_modules/loader-runner/lib/LoaderRunner.js:373:3 at iterateNormalLoaders (/mnt/c/Users/Magz/Desktop/tdlib/example/web/tdweb/node_modules/loader-runner/lib/LoaderRunner.js:214:10) at iterateNormalLoaders (/mnt/c/Users/Magz/Desktop/tdlib/example/web/tdweb/node_modules/loader-runner/lib/LoaderRunner.js:221:10) at /mnt/c/Users/Magz/Desktop/tdlib/example/web/tdweb/node_modules/loader-runner/lib/LoaderRunner.js:236:3 at context.callback (/mnt/c/Users/Magz/Desktop/tdlib/example/web/tdweb/node_modules/loader-runner/lib/LoaderRunner.js:111:13) at /mnt/c/Users/Magz/Desktop/tdlib/example/web/tdweb/node_modules/babel-loader/lib/index.js:51:71 at process.processTicksAndRejections (node:internal/process/task_queues:95:5) { opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ], library: 'digital envelope routines', reason: 'unsupported', code: 'ERR_OSSL_EVP_UNSUPPORTED' }

Node.js v18.20.3


getting prev error after command:

export NODE_OPTIONS=--openssl-legacy-provider

levlam commented 2 days ago

Running npm install in example/web/tdweb should help to resolve the error this[kHandle] = new _Hash(algorithm, xofLen);.

B0yma commented 2 days ago

@levlam npm install was success but after that with node js 16.20

./build-tdweb.sh

up to date, audited 823 packages in 5s

5 packages are looking for funding
  run `npm fund` for details

37 vulnerabilities (1 low, 10 moderate, 19 high, 7 critical)

To address issues that do not require attention, run:
  npm audit fix

To address all issues (including breaking changes), run:
  npm audit fix --force

Run `npm audit` for details.

> tdweb@1.8.1 build
> webpack --mode production

Browserslist: caniuse-lite is outdated. Please run next command `npm update`
Hash: 32154dc309c1a3e19b5b
Version: webpack 4.44.1
Time: 23279ms
Built at: 10/14/2024 7:03:22 PM
 6 assets
Entrypoint main = tdweb.js
 [7] ./src/worker.js 113 bytes {0} [not cacheable] [built]
 [9] multi ./src/index.js 28 bytes {0} [built]
[14] ../../src/methods/node.js (ignored) 15 bytes {0} [built]
[17] ./src/index.js + 9 modules 56.6 KiB {0} [built]
     | ./src/index.js 31.6 KiB [built]
     | ./src/logger.js 1.87 KiB [built]
     |     + 8 hidden modules
    + 14 hidden modules
Child worker:
     5 assets
    Entrypoint main = 5f2cf80795a56e78ed02.worker.js
     [6] ./src/prebuilt/release/td_wasm.wasm 83 bytes {0} [built]
     [7] ./src/prebuilt/release/td_asmjs.js.mem 82 bytes {0} [built]
     [9] (webpack)/buildin/global.js 472 bytes {0} [built]
    [10] ./node_modules/babel-loader/lib!./node_modules/eslint-loader!./src/worker.js + 2 modules 70.1 KiB {0} [built]
         | ./node_modules/babel-loader/lib!./node_modules/eslint-loader!./src/worker.js 61.1 KiB [built]
         | ./src/logger.js 1.87 KiB [built]
         | ./src/wasm-utils.js 7.08 KiB [built]
    [11] ./src/prebuilt/release/td_wasm.js 126 KiB {2} [built] [failed] [1 error]
    [12] ./src/prebuilt/release/td_asmjs.js 30.1 MiB {1} [built]
        + 7 hidden modules

    ERROR in ./src/prebuilt/release/td_wasm.js 8:4836
    Module parse failed: Unexpected token (8:4836)
    You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
    | function(moduleArg = {}) {
    |
    > var Module=moduleArg;var readyPromiseResolve,readyPromiseReject;Module["ready"]=new Promise((resolve,reject)=>{readyPromiseResolve=resolve;readyPromiseReject=reject});var moduleOverrides=Object.assign({},Module);var arguments_=[];var thisProgram="./this.program";var quit_=(status,toThrow)=>{throw toThrow};var ENVIRONMENT_IS_WEB=typeof window=="object";var ENVIRONMENT_IS_WORKER=typeof importScripts=="function";var ENVIRONMENT_IS_NODE=typeof 

...

();if(shouldRunNow)callMain();postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}var shouldRunNow=true;if(Module["noInitialRun"])shouldRunNow=false;run();createTdwebModule.ready.FS=Module.FS;
    |
    |
     @ ./src/worker.js (./node_modules/babel-loader/lib!./node_modules/eslint-loader!./src/worker.js) 272:19-58
levlam commented 11 hours ago

Could you check whether the recently pushed to Github version works for you?

asm.js support was removed and package-lock.json file was updated.

Scutua commented 9 hours ago

I think is work :-) hope is OK

On Thu, 17 Oct 2024, 05:08 Aliaksei Levin, @.***> wrote:

Could you check whether the recently pushed to Github version works for you?

asm.js support was removed and package-lock.json file was updated.

— Reply to this email directly, view it on GitHub https://github.com/tdlib/td/issues/3085#issuecomment-2418051609, or unsubscribe https://github.com/notifications/unsubscribe-auth/BJ4PV47AHIUTPHVTFZU4UFTZ33PVBAVCNFSM6AAAAABP2NUDZGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMJYGA2TCNRQHE . You are receiving this because you are subscribed to this thread.Message ID: @.***>