I already have a React built frontend that I want to use for the ic, but I have problems linking it correctly.
My project contains a build/
directory with an index.html
.
That html file links to everything needed (the build directory includes several sub directories and files alongside the index.html for assets and additional lazy loadable javascript, etc).
This is my dfx.json:
{
"canisters": {
"user": {
"main": "backend/user/main.mo",
"type": "motoko"
},
"syra_frontend": {
"dependencies": [
"user"
],
"frontend": {
"entrypoint": "build/index.html",
"output": "/"
},
"source": [
"build"
],
"type": "assets"
}
},
"defaults": {
"build": {
"output": "canisters/"
}
},
"networks": {
"local": {
"bind": "localhost:8000",
"type": "ephemeral"
},
"tungsten": {
"providers": [
"https://gw.dfinity.network"
],
"type": "persistent"
}
},
"dfx": "0.6.6",
"version": 1
}
Using dfx
it builds find on local and tungsten network and installation also runs without an error.
But opening the canister in the browser throws an error:
An error happened:
Error: Query failed:
Status: rejected
Message: not found
at r.retrieve (https://4zrvx-mypaa-aaaaa-aaaaa-aaaaa-aaaaa-aaaaa-q.ic0.app/bootstrap.js:2:43726)
at async _loadJs (https://4zrvx-mypaa-aaaaa-aaaaa-aaaaa-aaaaa-aaaaa-q.ic0.app/bootstrap.js:2:241980)
at async _main (https://4zrvx-mypaa-aaaaa-aaaaa-aaaaa-aaaaa-aaaaa-q.ic0.app/bootstrap.js:2:242870)
I am not quite sure what is wrong with the config. Would be great if somebody can help out here