algolia / renderscript

A custom JavaScript rendering engine based on Playwright
20 stars 6 forks source link

Docker build failing (command not found: ./scripts/update_adblock_hosts.sh) #883

Open janwillemwilmsen opened 1 month ago

janwillemwilmsen commented 1 month ago

Hi there, Managed to get the Renderscript app working locally (after pulling the latest github version, and updating Playwright to the latest version, and commenting out // '--disk-cache-dir=/dev/null', in src/lib/browser/constants.ts, and switching to Node 18.18.2 ).

But when trying to create the Docker container I get errors saying : RUN yarn build: 7.258 command not found: ./scripts/update_adblock_hosts.sh.

When building with this : "build": "yarn clean && yarn tsc" the container is created, but you get errors trying to run the container: err: Error: Error while setting up adblocker at Adblocker.load (/app/renderscript/dist/lib/browser/Adblocker.js:27:42) at async Object.init (/app/renderscript/dist/lib/singletons.js:13:9) at async /app/renderscript/dist/index.js:58:5, extra: { err: [Error: ENOENT: no such file or directory, open '/app/renderscript/dist/lib/browser/adblock_hosts.txt'] { errno: -2, code: 'ENOENT', syscall: 'open', path: '/app/renderscript/dist/lib/browser/adblock_hosts.txt' } }

I tried to run the 'update_adblock_hosts.sh' script from within the container, but didn't work(permissions). Do you have any suggestions on what to do?

dylantientcheu commented 1 month ago

Hi @janwillemwilmsen

The latest version updates the build command to: yarn clean && yarn tsc && yarn browser:adblocks see here: https://github.com/algolia/renderscript/blob/master/package.json#L7

From the errors, it seems like the version you are trying to compile doesn't have the new build command. Make sure you are using the latest master branch.

As for the playwright and dependencies upgrades; it will be handled in this PR: https://github.com/algolia/renderscript/pull/879

janwillemwilmsen commented 1 month ago

Tnx for your answer @dylantientcheu Did you manage to get the Docker running? I still keep getting the error. But found different solution, am investigating now...