a year ago
Hey folks. I'm debugging an issue with my deployment and it would really help if there was a way to have ssh access to my service or to download the docker image and run some commands on it. Is that something that's possible?
My issue is with the following package https://github.com/cloudflare/html-rewriter-wasm
Locally it works but I think that due to how its built the following line messes with the bundler:
const { awaitPromise, setWasmExports, wrap } = require(String.raw`./asyncify.js`);
and asyncify.js
is missing from the end bundle which causes the following error on my deployed service:
⨯ Error: Cannot find module './asyncify.js'
I verified that by using patch-packages and on my locally built docker the file is now present, however the issue persists on the railway built and deployed
Would appreciate any help on this đ
0 Replies
a year ago
is asyncify.js
a file you have in your project?
a year ago
are you using nixpacks?
but I think that weird require statement is messing up the nextjs bundler and on my built docker image I only see htmlrewriter.js and htmlrewriter_bg.wasm unless I replace that require line using patch-packages
a year ago
and you have built and ran an image from this dockerfile locally?
Basically added a patch file:
-const { awaitPromise, setWasmExports, wrap } = require(String.raw`./asyncify.js`);
+const { awaitPromise, setWasmExports, wrap } = require('./asyncify.js');
Then when I rebuild locally I do get the asyncify.js
to be a part of the final docker image
My hunch is that the patch isnt applied while building on railway, to verify that I'd need to access to end image and review the file system, hence my request above đ
a year ago
specifically built an image, not simply ran npm run build?
a year ago
railway uses buildx and I assume you aren't but that really shouldn't matter
Building with COMPOSE_DOCKER_CLI_BUILD=1 DOCKER_BUILDKIT=1
should know shortly if its any different
a year ago
sounds good
docker run --rm -it --entrypoint /bin/sh test-service
/app $ ls /app/node_modules/html-rewriter-wasm/dist/
asyncify.js html_rewriter.js html_rewriter_bg.wasm
(and just to re-iterate, if I don't use the patch above, the asyncify.js file doesn't exist, which casues the "cannot find module" error above)
a year ago
say you did have ssh and you logged in and saw that there was no asyncify.js file in the /node_modules/html-rewriter-wasm/dist/ folder, what would you do then?
Basically run the command above and check if asyncify.js
is there or not. If it's not then I know my patch isn't being applied, if it is then I'd have to go back to the drawing board đ
a year ago
and if the file wasn't there, what would you do