Hey there
I’m trying modify the code in this tutorial https://sdk.dfinity.org/docs/developers-guide/tutorials/custom-frontend.html. However I’m having some trouble using using a separate stylesheet. I have a file called index.css in the public/src directory however when I try to import it on the top with import “./index.css”; I get the following error in the browser:
An error happened:
Error: An error happened while retrieving asset "index.js":
Status: rejected
Message: IC0503: Canister ic:0D75C81A6F63E9FE95 trapped explicitly: assertion failed at /Users/dfinitybasics/dfnProject/hello/src/hello/main.mo-assets:7.25-7.37
at http://localhost:8000/index.js:2:144013
at async _loadJs (http://localhost:8000/index.js:2:89821)
at async _main (http://localhost:8000/index.js:2:90986)
when I prettify index.js this is where it seems to go wrong:
retrieveAsset(e, t) {
const r = f.encode([f.Text], [t]);
return this.query(e, {
methodName: "__dfx_asset_path",
arg: r
}).then(e=>{
switch (e.status) {
case "rejected":
throw new Error(`An error happened while retrieving asset "${t}":\n` + ` Status: ${e.status}\n` + ` Message: ${e.reject_message}\n`);
case "replied":
const [r] = f.decode([f.Text], e.reply.arg);
return i.toByteArray("" + r)
}
}
)
}
The file is in the same directory as index.jsx and when I comment the import out it seems to work fine. I looked at the linkup example and the stylesheet seems to be imported the same way so I don’t know what is going wrong here
Edit: Also it would be really nice to have a command that build and installs the canister and then opens the browser with the correct ID. It is a bit cumbersome to manually enter those commands yourself with every iteration and then manually copy the id.