SpikeHD / AmazonMonitor

Amazon price checker, item monitor and stock monitor, all shoved into a Discord bot
GNU General Public License v3.0
234 stars 39 forks source link

[BUG] Crash after git pull (update) #103

Closed kekkodance closed 1 year ago

kekkodance commented 1 year ago

Paste the contents of your config.json, excluding the token, here:

{
  "prefix":"!",
  "token":"token",
  "minutes_per_check":2,
  "search_response_ms": 30000,
  "url_params":{},
  "guild_item_limit":100,
  "cache_limit": 25,
  "required_perms":[""],
  "tld":"it",
  "auto_cart_link":false,
  "debug_enabled":true
}

Provide console output with debug mode enabled:

> amazonmonitor@3.0.0 start
> node --loader ts-node/esm index.ts

(node:337460) ExperimentalWarning: Custom ESM Loaders is an experimental feature and might change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
/home/ubuntu/AmazonMonitor/node_modules/ts-node/src/index.ts:859
    return new TSError(diagnosticText, diagnosticCodes, diagnostics);
           ^
TSError: ⨯ Unable to compile TypeScript:
common/browser.ts:16:5 - error TS2322: Type '"new"' is not assignable to type 'boolean | "chrome"'.

16     headless: 'new',
       ~~~~~~~~

  node_modules/puppeteer/lib/types.d.ts:664:5
    664     headless?: boolean | 'chrome';
            ~~~~~~~~
    The expected type comes from property 'headless' which is declared here on type 'LaunchOptions & BrowserLaunchArgumentOptions & BrowserConnectOptions & { product?: Product; extraPrefsFirefox?: Record<...>; }'

    at createTSError (/home/ubuntu/AmazonMonitor/node_modules/ts-node/src/index.ts:859:12)
    at reportTSError (/home/ubuntu/AmazonMonitor/node_modules/ts-node/src/index.ts:863:19)
    at getOutput (/home/ubuntu/AmazonMonitor/node_modules/ts-node/src/index.ts:1077:36)
    at Object.compile (/home/ubuntu/AmazonMonitor/node_modules/ts-node/src/index.ts:1433:41)
    at transformSource (/home/ubuntu/AmazonMonitor/node_modules/ts-node/src/esm.ts:400:37)
    at /home/ubuntu/AmazonMonitor/node_modules/ts-node/src/esm.ts:278:53
    at async addShortCircuitFlag (/home/ubuntu/AmazonMonitor/node_modules/ts-node/src/esm.ts:409:15)
    at async nextLoad (node:internal/modules/esm/loader:163:22)
    at async ESMLoader.load (node:internal/modules/esm/loader:603:20)
    at async ESMLoader.moduleProvider (node:internal/modules/esm/loader:457:11) {
  diagnosticCodes: [ 2322 ]
}
kekkodance commented 1 year ago

had to run npm update too, now getting this error:

> amazonmonitor@3.0.0 start
> node --loader ts-node/esm index.ts

(node:339574) ExperimentalWarning: Custom ESM Loaders is an experimental feature and might change at any time
(Use `node --trace-warnings ...` to show where the warning was created)

  ##########################################################################
   _____                                        __      __         __         .__                  
  /  _  \   _____ _____  ____________   ____   /  \    /  \_____ _/  |_  ____ |  |__   ___________ 
 /  /_\  \ /     \\__  \ \___   /  _ \ /    \  \   \/\/   /\__  \\   __\/ ___\|  |  \_/ __ \_  __ \
/    |    \  Y Y  \/ __ \_/    (  <_> )   |  \  \        /  / __ \|  | \  \___|   Y  \  ___/|  | \/
\____|__  /__|_|  (____  /_____ \____/|___|  /   \__/\  /  (____  /__|  \___  >___|  /\___  >__|   
        \/      \/     \/      \/          \/         \/        \/          \/     \/     \/       

  by SpikeHD (https://discord.gg/agQ9mRdHMZ)
  ##########################################################################

[MESSAGE]  Loaded command details
[MESSAGE]  Loaded command help
[MESSAGE]  Loaded command search
[MESSAGE]  Loaded command unwatch
[MESSAGE]  Loaded command watch
[MESSAGE]  Loaded command watchlist
[MESSAGE]  Bot is ready!
file:///home/ubuntu/AmazonMonitor/node_modules/@puppeteer/browsers/src/launch.ts:399
          new Error(
          ^
Error: Failed to launch the browser process!
/home/ubuntu/.cache/puppeteer/chrome/linux-115.0.5790.98/chrome-linux64/chrome: 15: Syntax error: word unexpected (expecting ")")

TROUBLESHOOTING: https://pptr.dev/troubleshooting

    at Interface.onClose (file:///home/ubuntu/AmazonMonitor/node_modules/@puppeteer/browsers/src/launch.ts:399:11)
    at Interface.emit (node:events:526:35)
    at Interface.emit (node:domain:489:12)
    at Interface.close (node:internal/readline/interface:533:10)
    at Socket.onend (node:internal/readline/interface:259:10)
    at Socket.emit (node:events:526:35)
    at Socket.emit (node:domain:489:12)
    at endReadableNT (node:internal/streams/readable:1359:12)
    at processTicksAndRejections (node:internal/process/task_queues:82:21)
SpikeHD commented 1 year ago

That looks like a bug with puppeteer, try deleting the entire node_modules folder and rerunning npm install

kekkodance commented 1 year ago

i did that, still broken..

slimshizn commented 1 year ago

@kekkodance what was your fix? I tried deleting the node_modules and re ran npm install. Still getting this issue.