create-ic-app icon indicating copy to clipboard operation
create-ic-app copied to clipboard

Deploy doesn´t works in ic

Open javierpineros opened this issue 1 year ago • 6 comments

I have a project created with create-ic-app@latest command, leaving intact it, it works fine in local, but it doesn´t works in ic, throwing the following javascript error in browser console:

image

Unable to fetch root key. Check to ensure that your local replica is running

Error: Failed to parse at Uint8ArrayDecoder$2._decode (index.6fb51243.js:65:66389) at Uint8ArrayDecoder$2.decodeFirst (index.6fb51243.js:65:66504) at decode$5 (index.6fb51243.js:66:10453) at HttpAgent$1.status (index.6fb51243.js:78:11) at async HttpAgent$1.fetchRootKey (index.6fb51243.js:78:108) (

caught (in promise) Error: Failed to parse at Uint8ArrayDecoder$2._decode (index.6fb51243.js:65:66389) at Uint8ArrayDecoder$2.decodeFirst (index.6fb51243.js:65:66504) at decode$5 (index.6fb51243.js:66:10453) at HttpAgent$1.query (index.6fb51243.js:72:11) at async _e (index.6fb51243.js:885:2960) at async pr (index.6fb51243.js:2786:3025)

I think that this happens when receiving the response from the backend canister, but I'm not entirely sure

The issue can be easily replicated by creating a project and deploying it to ic without making any changes or additions to the code like these commands:

npx create-ic-app dfx deploy --network ic --> set name, package empty, and select react option

Open the url with the frontend canister and check javascript console.

Thanks for your help

javierpineros avatar May 16 '23 14:05 javierpineros

Hello! same here! I have the same exact error. I am using the template-svelte-js and am having the same error on the deployed project. locally works fine (with plug wallet only though, because the Internet Identity button works for connecting but then the $wallet variable has not be filled and so it cannot be used).

Btw any suggestion on how to fix the parse error?

jacmos3 avatar May 19 '23 22:05 jacmos3

Hey guys, working on the new version... In the mean time you can try:

npm i -S @connect2ic/[email protected] @connect2ic/[email protected]

MioQuispe avatar May 21 '23 12:05 MioQuispe

Hello, thanks for reply and support

I've tried the svelte version ([email protected]) since I'm using svelte in the project, but after have imported it if I try to "dfx deploy" I receive this error:

Screenshot 2023-05-21 at 15 27 28

Btw which node and dfx versions do you suggest to work with connect2ic/[email protected]?

thanks

jacmos3 avatar May 21 '23 13:05 jacmos3

Hello, thanks for reply and support

I've tried the svelte version ([email protected]) since I'm using svelte in the project, but after have imported it if I try to "dfx deploy" I receive this error:

Screenshot 2023-05-21 at 15 27 28

Btw which node and dfx versions do you suggest to work with connect2ic/[email protected]?

thanks

try npm i -S regenerator-runtime

latest versions should be fine

MioQuispe avatar May 22 '23 13:05 MioQuispe

Ok now it builds and deploys (I'm using dfx 0.14.0, node 16.20.0, npm 8.19.4, and connect2ic 0.2.0-beta.23 both for core and svelte).

I was able to deploy to IC too, but I keep receiving the same error of the first message also with 0.2.0-beta.23 version

Screenshot 2023-05-22 at 21 27 55

jacmos3 avatar May 22 '23 19:05 jacmos3

When trying to login with AstroX, I receive this error: "Error: process is not defined" Screenshot 2023-05-22 at 23 16 37

When trying to login with Plug Wallet, I receive this other error (CONNECT_FAILED): Screenshot 2023-05-22 at 23 17 32

(In the local version, connect with plug wallet works fine tho)

When I try to login with II or StoicWallet, no errors appear, the "connect" button becomes "disconnect", but the $wallet variable is empty or false, so all the #if code which are listening to its changes, does not work properly....

You can see it in the console of this demo app: https://qfs7f-2yaaa-aaaao-ajnma-cai.icp0.io/

jacmos3 avatar May 22 '23 21:05 jacmos3