Skip to content

react sample can't find counter.did.js - (workaround provided) #28

@augchan42

Description

@augchan42

The counter.did.js file can't be found under ../.dfx/local/canisters/counter. I tried react+javascript and react+typescript. Seems the build needs to include dfx generate.

I had to: 1) generate the candid interfaces manually using dfx generate. 2) Update the App.jsx file with the proper import:

import * as counter from "../src/declarations/counter"

Stderr:
Could not resolve './counter.did.js' from .dfx/local/canisters/counter/index.js
error during build:
Error: Could not resolve './counter.did.js' from .dfx/local/canisters/counter/index.js
at error (/home/hosermage/projects/dfinity/create-ic-app/ledger_sample_react/node_modules/rollup/dist/shared/rollup.js:198:30)
at ModuleLoader.handleResolveId (/home/hosermage/projects/dfinity/create-ic-app/ledger_sample_react/node_modules/rollup/dist/shared/rollup.js:22464:24)
at /home/hosermage/projects/dfinity/create-ic-app/ledger_sample_react/node_modules/rollup/dist/shared/rollup.js:22427:26

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions