TheNetsky / Microsoft-Rewards-Script

Automated Microsoft Rewards script, using TypeScript, Cheerio and Playwright.
133 stars 33 forks source link

New update doesn't work #116

Closed Ampdale closed 1 month ago

Ampdale commented 1 month ago

src/browser/Browser.ts:1:24 - error TS2307: Cannot find module 'playwright' or its corresponding type declarations.

1 import playwright from 'playwright'


src/browser/Browser.ts:2:32 - error TS2307: Cannot find module 'playwright' or its corresponding type declarations.

2 import { BrowserContext } from 'playwright'

src/browser/Browser.ts:4:36 - error TS2307: Cannot find module 'fingerprint-injector' or its corresponding type declarations.

4 import { newInjectedContext } from 'fingerprint-injector'


src/browser/Browser.ts:5:38 - error TS2307: Cannot find module 'fingerprint-generator' or its corresponding type declarations.

5 import { FingerprintGenerator } from 'fingerprint-generator'

src/browser/BrowserFunc.ts:1:22 - error TS2307: Cannot find module 'playwright' or its corresponding type declarations.

1 import { Page } from 'playwright'


src/browser/BrowserFunc.ts:2:34 - error TS2307: Cannot find module 'cheerio' or its corresponding type declarations.

2 import { CheerioAPI, load } from 'cheerio'

src/browser/BrowserFunc.ts:106:64 - error TS7006: Parameter 'scriptContent' implicitly has an 'any' type.

106 const dashboardData = await this.bot.homePage.evaluate(scriptContent => {


src/browser/BrowserFunc.ts:197:55 - error TS7006: Parameter 'index' implicitly has an 'any' type.

197             const scriptContent = $('script').filter((index, element) => {

src/browser/BrowserFunc.ts:197:62 - error TS7006: Parameter 'element' implicitly has an 'any' type.

197 const scriptContent = $('script').filter((index, element) => {


src/browser/BrowserFunc.ts:257:60 - error TS7006: Parameter 'x' implicitly has an 'any' type.

257             const element = $('.offer-cta').toArray().find(x => x.attribs.href?.includes(activity.offerId))
                                                               ~

src/browser/BrowserUtil.ts:1:22 - error TS2307: Cannot find module 'playwright' or its corresponding type declarations.

1 import { Page } from 'playwright'

src/functions/Activities.ts:1:22 - error TS2307: Cannot find module 'playwright' or its corresponding type declarations.

1 import { Page } from 'playwright'


src/functions/activities/ABC.ts:1:22 - error TS2307: Cannot find module 'playwright' or its corresponding type declarations.

1 import { Page } from 'playwright'

src/functions/activities/Poll.ts:1:22 - error TS2307: Cannot find module 'playwright' or its corresponding type declarations.

1 import { Page } from 'playwright'


src/functions/activities/Quiz.ts:1:22 - error TS2307: Cannot find module 'playwright' or its corresponding type declarations.

1 import { Page } from 'playwright'

src/functions/activities/Quiz.ts:33:80 - error TS7006: Parameter 'el' implicitly has an 'any' type.

33 const answerAttribute = await answerSelector?.evaluate(el => el.getAttribute('iscorrectoption')) ~~

src/functions/activities/Quiz.ts:63:75 - error TS7006: Parameter 'el' implicitly has an 'any' type.

63 const dataOption = await answerSelector?.evaluate(el => el.getAttribute('data-option')) ~~

src/functions/activities/Search.ts:1:22 - error TS2307: Cannot find module 'playwright' or its corresponding type declarations.

1 import { Page } from 'playwright'


src/functions/activities/Search.ts:2:19 - error TS2307: Cannot find module 'axios' or its corresponding type declarations.

2 import axios from 'axios'

src/functions/activities/Search.ts:3:26 - error TS2307: Cannot find module 'os' or its corresponding type declarations.

3 import { platform } from 'os'


src/functions/activities/Search.ts:265:34 - error TS7006: Parameter 'scrollAmount' implicitly has an 'any' type.

265             await page.evaluate((scrollAmount) => {

src/functions/activities/ThisOrThat.ts:1:22 - error TS2307: Cannot find module 'playwright' or its corresponding type declarations.

1 import { Page } from 'playwright'


src/functions/activities/UrlReward.ts:1:22 - error TS2307: Cannot find module 'playwright' or its corresponding type declarations.

1 import { Page } from 'playwright'

src/functions/Login.ts:1:22 - error TS2307: Cannot find module 'playwright' or its corresponding type declarations.

1 import { Page } from 'playwright'


src/functions/Login.ts:2:22 - error TS2307: Cannot find module 'readline' or its corresponding type declarations.

2 import readline from 'readline'

src/functions/Login.ts:8:12 - error TS2580: Cannot find name 'process'. Do you need to install type definitions for node? Try npm i --save-dev @types/node.

8 input: process.stdin,


src/functions/Login.ts:9:13 - error TS2580: Cannot find name 'process'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.

9     output: process.stdout

src/functions/Login.ts:79:55 - error TS7006: Parameter 'input' implicitly has an 'any' type.

79 rl.question('Enter 2FA code:\n', (input) => {


src/functions/Workers.ts:1:22 - error TS2307: Cannot find module 'playwright' or its corresponding type declarations.

1 import { Page } from 'playwright'

src/index.ts:1:21 - error TS2307: Cannot find module 'cluster' or its corresponding type declarations.

1 import cluster from 'cluster'


src/index.ts:2:38 - error TS2307: Cannot find module 'playwright' or its corresponding type declarations.

2 import { BrowserContext, Page } from 'playwright'

src/index.ts:82:29 - error TS7006: Parameter 'worker' implicitly has an 'any' type.

82 cluster.on('exit', (worker, code) => {


src/index.ts:82:37 - error TS7006: Parameter 'code' implicitly has an 'any' type.

82         cluster.on('exit', (worker, code) => {

src/index.ts:90:17 - error TS2580: Cannot find name 'process'. Do you need to install type definitions for node? Try npm i --save-dev @types/node.

90 process.exit(0)


src/index.ts:96:38 - error TS2580: Cannot find name 'process'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.

96         log('MAIN-WORKER', `Worker ${process.pid} spawned`)

src/index.ts:98:9 - error TS2580: Cannot find name 'process'. Do you need to install type definitions for node? Try npm i --save-dev @types/node.

98 process.on('message', async ({ chunk }) => {


src/index.ts:98:40 - error TS7031: Binding element 'chunk' implicitly has an 'any' type.

98         process.on('message', async ({ chunk }) => {

src/index.ts:123:9 - error TS2580: Cannot find name 'process'. Do you need to install type definitions for node? Try npm i --save-dev @types/node.

123 process.exit(0)


src/util/Load.ts:1:40 - error TS2307: Cannot find module 'playwright' or its corresponding type declarations.

1 import { BrowserContext, Cookie } from 'playwright'

src/util/Load.ts:2:47 - error TS2307: Cannot find module 'fingerprint-generator' or its corresponding type declarations.

2 import { BrowserFingerprintWithHeaders } from 'fingerprint-generator'


src/util/Load.ts:3:16 - error TS2307: Cannot find module 'fs' or its corresponding type declarations.

3 import fs from 'fs'

src/util/Load.ts:4:18 - error TS2307: Cannot find module 'path' or its corresponding type declarations.

4 import path from 'path'


src/util/Load.ts:16:13 - error TS2580: Cannot find name 'process'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.

16         if (process.argv.includes('-dev')) {

src/util/Load.ts:20:38 - error TS2304: Cannot find name '__dirname'.

20 const accountDir = path.join(__dirname, '../', file)


src/util/Load.ts:31:37 - error TS2304: Cannot find name '__dirname'.

31         const configDir = path.join(__dirname, '../', 'config.json')

src/util/Load.ts:43:38 - error TS2304: Cannot find name '__dirname'.

43 const cookieFile = path.join(__dirname, '../browser/', sessionPath, email, ${isMobile ? 'mobile_cookies' : 'desktop_cookies'}.json)


src/util/Load.ts:52:43 - error TS2304: Cannot find name '__dirname'.

52         const fingerprintFile = path.join(__dirname, '../browser/', sessionPath, email, `${isMobile ? 'mobile_fingerpint' : 'desktop_fingerpint'}.json`)

src/util/Load.ts:75:38 - error TS2304: Cannot find name '__dirname'.

75 const sessionDir = path.join(__dirname, '../browser/', sessionPath, email)


src/util/Load.ts:94:38 - error TS2304: Cannot find name '__dirname'.

94         const sessionDir = path.join(__dirname, '../browser/', sessionPath, email)

src/util/Logger.ts:10:45 - error TS2580: Cannot find name 'process'. Do you need to install type definitions for node? Try npm i --save-dev @types/node.

10 str = [${currentTime}] [PID: ${process.pid}] [WARN] [${title}] ${message}


src/util/Logger.ts:15:45 - error TS2580: Cannot find name 'process'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.

15             str = `[${currentTime}] [PID: ${process.pid}] [ERROR] [${title}] ${message}`

src/util/Logger.ts:20:45 - error TS2580: Cannot find name 'process'. Do you need to install type definitions for node? Try npm i --save-dev @types/node.

20 str = [${currentTime}] [PID: ${process.pid}] [LOG] [${title}] ${message}


src/util/UserAgent.ts:1:19 - error TS2307: Cannot find module 'axios' or its corresponding type declarations.

1 import axios from 'axios'

src/util/Webhook.ts:1:19 - error TS2307: Cannot find module 'axios' or its corresponding type declarations.

1 import axios from 'axios'



Found 54 errors in 17 files.

Errors  Files
     4  src/browser/Browser.ts:1
     6  src/browser/BrowserFunc.ts:1
     1  src/browser/BrowserUtil.ts:1
     1  src/functions/Activities.ts:1
     1  src/functions/activities/ABC.ts:1
     1  src/functions/activities/Poll.ts:1
     3  src/functions/activities/Quiz.ts:1
     4  src/functions/activities/Search.ts:1
     1  src/functions/activities/ThisOrThat.ts:1
     1  src/functions/activities/UrlReward.ts:1
     5  src/functions/Login.ts:1
     1  src/functions/Workers.ts:1
     9  src/index.ts:1
    11  src/util/Load.ts:1
     3  src/util/Logger.ts:10
     1  src/util/UserAgent.ts:1
     1  src/util/Webhook.ts:1
serzak51 commented 1 month ago

That does seems strange. How did you update the script? The best way to do it is to backup your account.json, config.json and the session folder, install the new version, and then paste them into the new version. What i think is happening is that he doesn't find the modules. Maybe you didn't make the npm i in the reinstallation?

TheNetsky commented 1 month ago

Seems indeed like you missed a step by installing the packages.