rust-yew-realworld-example-app
rust-yew-realworld-example-app copied to clipboard
Error when loading the website in docker
Describe the bug A clear and concise description of what the bug is.
To Reproduce Steps to reproduce the behavior:
- Load docker in Fedora 36
- Run docker compose up
- Access website at port 8000
Expected behavior No errors
Screenshots
Desktop (please complete the following information):
- OS: Fedora 36 KDE
- Browser Chrome and Firefox / N.A
- Version N.A
@jetli do you have any idea what a possible fix for this could look like? If you can give me a couple of thoughts I would be happy to look into this and submit a PR.
@TeaDrinkingProgrammer have you fixed it yet or do you have any ideas?
@adriaanjoubert this is the docker file and step to copy .env file: https://github.com/jetli/rust-yew-realworld-example-app/blob/2f65dd1f5fa75b49bc358f606780f9b5507ed560/Dockerfile#L14
seems something wrong with the result path: /usr/src/conduit-wasm/../../.env
@adriaanjoubert this is the docker file and step to copy .env file:
https://github.com/jetli/rust-yew-realworld-example-app/blob/2f65dd1f5fa75b49bc358f606780f9b5507ed560/Dockerfile#L14
seems something wrong with the result path:
/usr/src/conduit-wasm/../../.env
Thanks, do you mean we should change COPY .env.example .env
in the Dockerfile to COPY .env.example /usr/.env
?
Doing that results in a different error:
Uncaught TypeError: Cannot read properties of undefined (reading 'memory')
at parcelRequire.../node_modules/parcel-plugin-wasm.rs/wasm-loader.js.fs (wasm-loader.js:913:1)
at newRequire (static.77de5100.js:47:24)
at localRequire (static.77de5100.js:53:14)
at parcelRequire.0 (wasm-loader.js:958:1)
at newRequire (static.77de5100.js:47:24)
at static.77de5100.js:81:7
at static.77de5100.js:120:3
I would be happy to look into this a bit further if you can give me some pointers of where to look.
Out of interest, are you currently able to build and run the project with docker-compose up --build
?
As an aside, I see the Dockerfile
installs wasm-pack
from https://rustwasm.github.io/wasm-pack/installer/init.sh
. Is there maybe a way we can pin the version of wasm-pack
in the Dockerfile
, perhaps by using a version of the init.sh
script you used when adding Docker support?
Happy to hear your thoughts.
switched to trunk