Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] contract alias contains nonexisting network previewnet #63

Closed
bartolomej opened this issue Jun 25, 2024 · 2 comments
Closed

[BUG] contract alias contains nonexisting network previewnet #63

bartolomej opened this issue Jun 25, 2024 · 2 comments

Comments

@bartolomej
Copy link
Contributor

Current Behavior

flowkit.Load function returns a contract {ContractName} alias contains nonexisting network previewnet error when these conditions are met:

  • target contract is listed in dependencies section of flow.json, but not in contracts section
  • target contract is a core contract
  • there is no "previewnet" network configured in networks section

This happens because when flowkit automatically populates missing contracts from dependency list, it uses all supported networks for core contracts:

for _, networkStr := range supportedNetworks() {

This is a regression since: #55

Expected Behavior

This error was quite confusing to me, as my flow.json didn't have any mention of "previewnet", so I wasn't sure what's going on.

I would expect the flowkit logic to automatically add "previewnet" in the internal networks config struct in cases like these, instead of requiring the dev to do so.

Steps To Reproduce

  1. Clone https://github.com/onflowser/flow-wasm at this commit: onflowser/flow-wasm@c4b2747
  2. Run ./build.sh to generate flow.wasm
  3. Open index.html and check developer console

Environment

Note that this does not happen in the released version! This issue can be reproduced in the latest unreleased code since the commit: https://github.com/onflow/flowkit/commit/cc49f8310c70dfd47614c604288b47990e9a18b4

What are you currently working on that this is blocking?

I'm playing around with building a revamped web-based playground and have started testing with example scaffold projects (e.g. https://github.com/onflowser/flow-nft-scaffold). This was proposed in the grant: onflow/developer-grants#260.

bartolomej added a commit to onflowser/flow-nft-scaffold that referenced this issue Jun 25, 2024
@gregsantos
Copy link

Thanks @bartolomej for the flag

nvdtf pushed a commit to nvdtf/flow-nft-scaffold that referenced this issue Sep 9, 2024
* udpate to use dependency manager
* add previewnet config as a workaround for onflow/flowkit#63
* update dependencies to point previewnet
* run flow deps install to update flow.json
* update cadence source code
* update flow.json
* update readme
* update cadence scripts and readme
@jribbink
Copy link
Contributor

This should be resolved in the most recent release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants