dfinity / dfinity/sdk

Error: Failed while trying to deploy canisters.

Open
#3,315 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
204
Forks
98
PR merge metrics
No merged PRs in 30d

Description

dfx deploy
Deploying all canisters.
Creating a wallet canister on the local network.
The wallet canister on the "local" network for user "default" is "bnz7o-iuaaa-aaaaa-qaaaa-cai"
Creating canisters...
Creating canister dbank...
dbank canister created with canister id: bkyz2-fmaaa-aaaaa-qaaaq-cai
Creating canister dbank_assets...
dbank_assets canister created with canister id: bd3sg-teaaa-aaaaa-qaaba-cai
Building canisters...
Building frontend...
Error: Failed while trying to deploy canisters.
Caused by: Failed while trying to deploy canisters.
Failed to build all canisters.
Failed while trying to build all canisters.
The post-build step failed for canister 'bd3sg-teaaa-aaaaa-qaaba-cai' (dbank_assets) with an embedded error: Failed to build frontend for network 'local'.: The command '"npm" "run" "build"' failed with exit status 'exit status: 1'.
Stdout:

dbank_assets@0.1.0 prebuild
npm run copy:types

dbank_assets@0.1.0 copy:types
rsync -avr .dfx/$(echo ${DFX_NETWORK:-''})/canisters/ --exclude='assets/' --exclude='idl/' --exclude='.wasm' --exclude='.most' --delete src/declarations

sending incremental file list
deleting dbank/dbank.old.did
deleting dbank/dbank.did.js
deleting dbank/dbank.did.d.ts
deleting dbank_assets/dbank_assets.did.js
deleting dbank_assets/dbank_assets.did.d.ts
deleting dbank_assets/dbank_assets.did
dbank/
dbank/constructor.did
dbank/dbank.did
dbank/index.js
dbank/init_args.txt
dbank/service.did
dbank/service.did.d.ts
dbank/service.did.js
dbank_assets/
dbank_assets/assetstorage.wasm.gz
dbank_assets/constructor.did
dbank_assets/dbank_assets.wasm.gz
dbank_assets/index.js
dbank_assets/init_args.txt
dbank_assets/service.did
dbank_assets/service.did.d.ts
dbank_assets/service.did.js

sent 881,816 bytes received 489 bytes 1,764,610.00 bytes/sec
total size is 887,095 speedup is 1.01

dbank_assets@0.1.0 build
webpack

No production canister_ids.json found. Continuing with local
asset index.js 623 KiB [emitted] (name: index) 1 related asset
asset favicon.ico 15 KiB [compared for emit] [from: src/dbank_assets/assets/favicon.ico] [copied]
asset dbank_logo.png 11.4 KiB [compared for emit] [from: src/dbank_assets/assets/dbank_logo.png] [copied]
asset main.css 2.04 KiB [compared for emit] [from: src/dbank_assets/assets/main.css] [copied]
asset index.html 873 bytes [compared for emit]
asset sample-asset.txt 24 bytes [compared for emit] [from: src/dbank_assets/assets/sample-asset.txt] [copied]
runtime modules 1.16 KiB 6 modules
modules by path ./node_modules/@dfinity/ 235 KiB 37 modules
modules by path ./node_modules/borc/ 113 KiB 10 modules
modules by path ./node_modules/simple-cbor/src/*.js 17.5 KiB
./node_modules/simple-cbor/src/index.js 595 bytes [built] [code generated]
./node_modules/simple-cbor/src/serializer.js 4.93 KiB [built] [code generated]
./node_modules/simple-cbor/src/value.js 12 KiB [built] [code generated]
modules by path ./node_modules/iso-url/ 4.36 KiB
./node_modules/iso-url/index.js 285 bytes [built] [code generated]
./node_modules/iso-url/src/url-browser.js 3.39 KiB [built] [code generated]
./node_modules/iso-url/src/relative.js 711 bytes [built] [code generated]
modules by path ./src/ 3.02 KiB
./src/dbank_assets/src/index.js 1.12 KiB [built] [code generated]
./src/declarations/dbank/index.js 1.9 KiB [built] [code generated]
7 modules

ERROR in ./src/declarations/dbank/index.js 4:0-44
Module not found: Error: Can't resolve './dbank.did.js' in '/home/kcalb/ic-projects/dbank/src/declarations/dbank'
resolve './dbank.did.js' in '/home/kcalb/ic-projects/dbank/src/declarations/dbank'
using description file: /home/kcalb/ic-projects/dbank/package.json (relative path: ./src/declarations/dbank)
Field 'browser' doesn't contain a valid alias configuration
using description file: /home/kcalb/ic-projects/dbank/package.json (relative path: ./src/declarations/dbank/dbank.did.js)
no extension
Field 'browser' doesn't contain a valid alias configuration
/home/kcalb/ic-projects/dbank/src/declarations/dbank/dbank.did.js doesn't exist
.js
Field 'browser' doesn't contain a valid alias configuration
/home/kcalb/ic-projects/dbank/src/declarations/dbank/dbank.did.js.js doesn't exist
.ts
Field 'browser' doesn't contain a valid alias configuration
/home/kcalb/ic-projects/dbank/src/declarations/dbank/dbank.did.js.ts doesn't exist
.jsx
Field 'browser' doesn't contain a valid alias configuration
/home/kcalb/ic-projects/dbank/src/declarations/dbank/dbank.did.js.jsx doesn't exist
.tsx
Field 'browser' doesn't contain a valid alias configuration
/home/kcalb/ic-projects/dbank/src/declarations/dbank/dbank.did.js.tsx doesn't exist
as directory
/home/kcalb/ic-projects/dbank/src/declarations/dbank/dbank.did.js doesn't exist
@ ./src/dbank_assets/src/index.js 1:0-47 6:28-46 23:10-21 27:10-24 31:29-47

webpack 5.63.0 compiled with 1 error in 1099 ms

Stderr:

kcalb@Nikhil-Harsha:~/ic-projects/dbank$ npm install

up to date, audited 408 packages in 2s

68 packages are looking for funding
run npm fund for details

1 high severity vulnerability

To address all issues, run:
npm audit fix --force

Run npm audit for details.
kcalb@Nikhil-Harsha:~/ic-projects/dbank$ dfx deploy --network ic
WARN: The default identity is not stored securely. Do not use it to control a lot of cycles/ICP. Create a new identity with dfx identity new and use it in mainnet-facing commands with the --identity flag
Deploying all canisters.
Creating canisters...
Creating canister dbank...
dbank canister created on network ic with canister id: gn6z2-pyaaa-aaaal-acxkq-cai
Creating canister dbank_assets...
dbank_assets canister created on network ic with canister id: ge5sg-zqaaa-aaaal-acxla-cai
Building canisters...
Building frontend...
Error: Failed while trying to deploy canisters.
Caused by: Failed while trying to deploy canisters.
Failed to build all canisters.
Failed while trying to build all canisters.
The post-build step failed for canister 'ge5sg-zqaaa-aaaal-acxla-cai' (dbank_assets) with an embedded error: Failed to build frontend for network 'ic'.: The command '"npm" "run" "build"' failed with exit status 'exit status: 1'.
Stdout:

dbank_assets@0.1.0 prebuild
npm run copy:types

dbank_assets@0.1.0 copy:types
rsync -avr .dfx/$(echo ${DFX_NETWORK:-''})/canisters/ --exclude='assets/' --exclude='idl/' --exclude='.wasm' --exclude='.most' --delete src/declarations

sending incremental file list
dbank/
dbank/constructor.did
dbank/dbank.did
dbank/index.js
dbank/init_args.txt
dbank/service.did
dbank/service.did.d.ts
dbank/service.did.js
dbank_assets/
dbank_assets/assetstorage.wasm.gz
dbank_assets/constructor.did
dbank_assets/dbank_assets.wasm.gz
dbank_assets/index.js
dbank_assets/init_args.txt
dbank_assets/service.did
dbank_assets/service.did.d.ts
dbank_assets/service.did.js

sent 881,828 bytes received 313 bytes 1,764,282.00 bytes/sec
total size is 887,095 speedup is 1.01

dbank_assets@0.1.0 build
webpack

assets by status 271 KiB [cached] 6 assets
orphan modules 207 KiB [orphan] 29 modules
runtime modules 1.16 KiB 6 modules
cacheable modules 547 KiB
modules by path ./node_modules/borc/ 113 KiB 10 modules
modules by path ./node_modules/@dfinity/ 184 KiB
modules by path ./node_modules/@dfinity/agent/lib/esm/ 96.2 KiB 7 modules
2 modules
modules by path ./node_modules/simple-cbor/src/*.js 17.5 KiB
./node_modules/simple-cbor/src/index.js 595 bytes [built] [code generated]
./node_modules/simple-cbor/src/serializer.js 4.93 KiB [built] [code generated]
./node_modules/simple-cbor/src/value.js 12 KiB [built] [code generated]
modules by path ./node_modules/iso-url/ 4.36 KiB
./node_modules/iso-url/index.js 285 bytes [built] [code generated]
./node_modules/iso-url/src/url-browser.js 3.39 KiB [built] [code generated]
./node_modules/iso-url/src/relative.js 711 bytes [built] [code generated]

ERROR in ./src/declarations/dbank/index.js 4:0-44
Module not found: Error: Can't resolve './dbank.did.js' in '/home/kcalb/ic-projects/dbank/src/declarations/dbank'
resolve './dbank.did.js' in '/home/kcalb/ic-projects/dbank/src/declarations/dbank'
using description file: /home/kcalb/ic-projects/dbank/package.json (relative path: ./src/declarations/dbank)
Field 'browser' doesn't contain a valid alias configuration
using description file: /home/kcalb/ic-projects/dbank/package.json (relative path: ./src/declarations/dbank/dbank.did.js)
no extension
Field 'browser' doesn't contain a valid alias configuration
/home/kcalb/ic-projects/dbank/src/declarations/dbank/dbank.did.js doesn't exist
.js
Field 'browser' doesn't contain a valid alias configuration
/home/kcalb/ic-projects/dbank/src/declarations/dbank/dbank.did.js.js doesn't exist
.ts
Field 'browser' doesn't contain a valid alias configuration
/home/kcalb/ic-projects/dbank/src/declarations/dbank/dbank.did.js.ts doesn't exist
.jsx
Field 'browser' doesn't contain a valid alias configuration
/home/kcalb/ic-projects/dbank/src/declarations/dbank/dbank.did.js.jsx doesn't exist
.tsx
Field 'browser' doesn't contain a valid alias configuration
/home/kcalb/ic-projects/dbank/src/declarations/dbank/dbank.did.js.tsx doesn't exist
as directory
/home/kcalb/ic-projects/dbank/src/declarations/dbank/dbank.did.js doesn't exist
@ ./src/dbank_assets/src/index.js 1:0-47 6:28-46 23:10-21 27:10-24 31:29-47

webpack 5.63.0 compiled with 1 error in 4540 ms

Stderr:

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure with dfx deploy and npm run build, then inspect src/declarations/dbank/index.js and the copy:types prebuild step. The reported failure is webpack's missing ./dbank.did.js; done should be a successful frontend build and canister deployment for the affected network.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, webpack
Domain
build-system, frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.