Closed mokkin closed 1 year ago
From the stack trace in error message:
cd /tmp/ && /usr/local/bin/pageres 'http://website.de' 1366x768 --user-agent='Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:80.0) Gecko/20100101 Firefox/80.0' --delay=4 --filename='631082cb8d462' --overwrite 2>&1
Output: /usr/local/lib/node_modules/pageres-cli/cli.js:2
import process from 'node:process';
^^^^^^^
SyntaxError: Unexpected identifier
at Module._compile (internal/modules/cjs/loader.js:723:23)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)
It looks like pageres on your server is not or no longer working. Most likely it is incompatible with the node version that is currently being used.
System Information
Server:
Client:
Steps to reproduce
Expected result
create preview
Actual result
no preview shown
Nextcloud log
Nextcloud log
``` {"reqId":"rSh9NYXELGeV9Amet6tJ","level":4,"time":"2022-09-01T12:00:45+02:00","remoteAddr":"79.140.xxx.yyy","user":"zzz","app":"passwords","method":"GET","url":"/index.php/apps/passwords/api/1.0/service/preview/kundenkonto.lidl-connect.de/desktop/640/360...","message":"Pageres Error\nCommand: cd /tmp/ && /usr/local/bin/pageres 'http://kundenkonto.lidl-connect.de' 1366x768 --user-agent='Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:80.0) Gecko/20100101 Firefox/80.0' --delay=4 --filename='631082cb8d462' --overwrite 2>&1\nOutput: /usr/local/lib/node_modules/pageres-cli/cli.js:2 \nimport process from 'node:process'; \n ^^^^^^^ \n \nSyntaxError: Unexpected identifier \n at Module._compile (internal/modules/cjs/loader.js:723:23) \n at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10) \n at Module.load (internal/modules/cjs/loader.js:653:32) \n at tryModuleLoad (internal/modules/cjs/loader.js:593:12) \n at Function.Module._load (internal/modules/cjs/loader.js:585:3) \n at Function.Module.runMain (internal/modules/cjs/loader.js:831:12) \n at startup (internal/bootstrap/node.js:283:19) \n at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)\n","userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:104.0) Gecko/20100101 Firefox/104.0","version":"24.0.4.1","exception":{"Exception":"Exception","Message":"Pageres Error\nCommand: cd /tmp/ && /usr/local/bin/pageres 'http://kundenkonto.lidl-connect.de' 1366x768 --user-agent='Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:80.0) Gecko/20100101 Firefox/80.0' --delay=4 --filename='631082cb8d462' --overwrite 2>&1\nOutput: /usr/local/lib/node_modules/pageres-cli/cli.js:2 \nimport process from 'node:process'; \n ^^^^^^^ \n \nSyntaxError: Unexpected identifier \n at Module._compile (internal/modules/cjs/loader.js:723:23) \n at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10) \n at Module.load (internal/modules/cjs/loader.js:653:32) \n at tryModuleLoad (internal/modules/cjs/loader.js:593:12) \n at Function.Module._load (internal/modules/cjs/loader.js:585:3) \n at Function.Module.runMain (internal/modules/cjs/loader.js:831:12) \n at startup (internal/bootstrap/node.js:283:19) \n at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)\n","Code":0,"Trace":[{"file":"/var/www/nextcloud/apps/passwords/lib/Helper/Preview/PageresCliHelper.php","line":66,"function":"getPreviewData","class":"OCA\\Passwords\\Helper\\Preview\\PageresCliHelper","type":"->"},{"file":"/var/www/nextcloud/apps/passwords/lib/Helper/Preview/AbstractPreviewHelper.php","line":99,"function":"getPreviewData","class":"OCA\\Passwords\\Helper\\Preview\\PageresCliHelper","type":"->"},{"file":"/var/www/nextcloud/apps/passwords/lib/Services/WebsitePreviewService.php","line":127,"function":"getPreview","class":"OCA\\Passwords\\Helper\\Preview\\AbstractPreviewHelper","type":"->"},{"file":"/var/www/nextcloud/apps/passwords/lib/Services/WebsitePreviewService.php","line":103,"function":"getWebsitePreview","class":"OCA\\Passwords\\Services\\WebsitePreviewService","type":"->"},{"file":"/var/www/nextcloud/apps/passwords/lib/Controller/Api/ServiceApiController.php","line":208,"function":"getPreview","class":"OCA\\Passwords\\Services\\WebsitePreviewService","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":225,"function":"getPreview","class":"OCA\\Passwords\\Controller\\Api\\ServiceApiController","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":133,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/App.php","line":172,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/Route/Router.php","line":298,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/var/www/nextcloud/lib/base.php","line":1023,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/nextcloud/index.php","line":36,"function":"handleRequest","class":"OC","type":"::"}],"File":"/var/www/nextcloud/apps/passwords/lib/Helper/Preview/PageresCliHelper.php","Line":68,"message":"Pageres Error\nCommand: cd /tmp/ && /usr/local/bin/pageres 'http://kundenkonto.lidl-connect.de' 1366x768 --user-agent='Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:80.0) Gecko/20100101 Firefox/80.0' --delay=4 --filename='631082cb8d462' --overwrite 2>&1\nOutput: /usr/local/lib/node_modules/pageres-cli/cli.js:2 \nimport process from 'node:process'; \n ^^^^^^^ \n \nSyntaxError: Unexpected identifier \n at Module._compile (internal/modules/cjs/loader.js:723:23) \n at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10) \n at Module.load (internal/modules/cjs/loader.js:653:32) \n at tryModuleLoad (internal/modules/cjs/loader.js:593:12) \n at Function.Module._load (internal/modules/cjs/loader.js:585:3) \n at Function.Module.runMain (internal/modules/cjs/loader.js:831:12) \n at startup (internal/bootstrap/node.js:283:19) \n at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)\n","exception":[],"CustomMessage":"Pageres Error\nCommand: cd /tmp/ && /usr/local/bin/pageres 'http://kundenkonto.lidl-connect.de' 1366x768 --user-agent='Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:80.0) Gecko/20100101 Firefox/80.0' --delay=4 --filename='631082cb8d462' --overwrite 2>&1\nOutput: /usr/local/lib/node_modules/pageres-cli/cli.js:2 \nimport process from 'node:process'; \n ^^^^^^^ \n \nSyntaxError: Unexpected identifier \n at Module._compile (internal/modules/cjs/loader.js:723:23) \n at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10) \n at Module.load (internal/modules/cjs/loader.js:653:32) \n at tryModuleLoad (internal/modules/cjs/loader.js:593:12) \n at Function.Module._load (internal/modules/cjs/loader.js:585:3) \n at Function.Module.runMain (internal/modules/cjs/loader.js:831:12) \n at startup (internal/bootstrap/node.js:283:19) \n at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)\n"},"id":"631082d8012e1"} ```Browser log
Browser log
``` Press F12, copy the content of the console tab ```