rust-yew-realworld-example-app icon indicating copy to clipboard operation
rust-yew-realworld-example-app copied to clipboard

Error when loading the website in docker

Open TeaDrinkingProgrammer opened this issue 2 years ago • 3 comments

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

  1. Load docker in Fedora 36
  2. Run docker compose up
  3. Access website at port 8000

Expected behavior No errors

Screenshots docker error yew

Desktop (please complete the following information):

  • OS: Fedora 36 KDE
  • Browser Chrome and Firefox / N.A
  • Version N.A

TeaDrinkingProgrammer avatar May 24 '22 08:05 TeaDrinkingProgrammer

@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 avatar Jun 16 '22 09:06 adriaanjoubert

@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

jetli avatar Jun 17 '22 01:06 jetli

@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.

adriaanjoubert avatar Jun 17 '22 16:06 adriaanjoubert

switched to trunk

jetli avatar Jul 19 '23 15:07 jetli