drawrowfly / tiktok-scraper

TikTok Scraper. Download video posts, collect user/trend/hashtag/music feed metadata, sign URL and etc.
4.44k stars 805 forks source link

TypeError: Cannot read properties of undefined (reading 'getUserProfileInfo') #765

Open zaptrem opened 2 years ago

zaptrem commented 2 years ago

Describe the bug

I get the following error whenever I call getUserProfileInfo() (my code uses 'ford' as an example username)

TypeError: Cannot read properties of undefined (reading 'getUserProfileInfo')
    at /Users/zaptrem/my-project/dist/index.js:296:67
    at step (/Users/zaptrem/my-project/dist/index.js:56:23)
    at Object.next (/Users/zaptrem/my-project/dist/index.js:37:53)
    at /Users/zaptrem/my-project/dist/index.js:31:71
    at new Promise (<anonymous>)
    at __awaiter (/Users/zaptrem/my-project/dist/index.js:27:12)
    at checkTikTok (/Users/zaptrem/my-project/dist/index.js:289:12)
    at /Users/zaptrem/my-project/dist/index.js:114:42
    at step (/Users/zaptrem/my-project/dist/index.js:56:23)
    at Object.next (/Users/zaptrem/my-project/dist/index.js:37:53)
    at /Users/zaptrem/my-project/dist/index.js:31:71
    at new Promise (<anonymous>)
    at __awaiter (/Users/zaptrem/my-project/dist/index.js:27:12)
    at handler (/Users/zaptrem/my-project/dist/index.js:79:41)
    at Object.<anonymous> (/Users/zaptrem/my-project/dist/index.js:384:25)
    at Module._compile (node:internal/modules/cjs/loader:1105:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
    at node:internal/main/run_main_module:17:47

To Reproduce Steps to reproduce the behavior:

bwp91 commented 2 years ago

I was getting the same error when using webpack.

I changed import TikTokApi from 'tiktok-web-api' to import * as TikTokApi from 'tiktok-web-api' and seemed to fix.

Note I am using the tiktok-web-api package rather than tiktok-scraper.

Ahmad1309 commented 1 year ago

I have the same problem what we can do

Failed to like video by : Cannot read property 'signURL' of undefined