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: wagmi-cli generate functions with no argument type #2783

Closed
1 task done
estarossa0 opened this issue Jul 21, 2023 · 3 comments
Closed
1 task done

bug: wagmi-cli generate functions with no argument type #2783

estarossa0 opened this issue Jul 21, 2023 · 3 comments
Labels
Needs Reproduction Misc: Needs Reproduction

Comments

@estarossa0
Copy link
Contributor

estarossa0 commented Jul 21, 2023

Is there an existing issue for this?

  • I have searched the existing issues

Package Version

1.3.9

Current Behavior

When running wagmi generate, I get all the function and hooks with no types like:

export function useErc20Allowance(config = {}) {
  return useContractRead({ abi: erc20ABI, functionName: 'allowance', ...config })
}
export function useErc20BalanceOf(config = {}) {
  return useContractRead({ abi: erc20ABI, functionName: 'balanceOf', ...config })
}

with the config file from the docs.

Expected Behavior

the functions argument type should not be config = {} but instead be typed correctly.

Steps To Reproduce

No response

Link to Minimal Reproducible Example (StackBlitz, CodeSandbox, GitHub repo etc.)

No response

Anything else?

node: v19.9.0
tsconfig.json:

{
  "compileOnSave": false,
  "compilerOptions": {
    "strict": true,
    "rootDir": ".",
    "sourceMap": true,
    "declaration": false,
    "moduleResolution": "node",
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "importHelpers": true,
    "target": "es2015",
    "module": "esnext",
    "lib": ["es2020", "dom"],
    "skipLibCheck": true,
    "skipDefaultLibCheck": true,
}

project is using a monorepo using nx and nextjs apps.

@tmm
Copy link
Member

tmm commented Jul 21, 2023

Thanks for reporting. This issue is temporarily closed due to lack of information. Please provide a minimal reproducible example and reopen this issue.

@tmm tmm closed this as not planned Won't fix, can't repro, duplicate, stale Jul 21, 2023
@tmm tmm added the Needs Reproduction Misc: Needs Reproduction label Jul 21, 2023
@estarossa0
Copy link
Contributor Author

The issue here was that on root folder, I hade a tsconfig.base.josn and other apps in the monorepo were extending it in their own tsconfig.json, I don't know what tsconfig wagmi-cli was using maybe one of from the subfolders, but once I changed tscofig.base.json to tsconfig.json it worked fine.

@tmm sorry I couldn't reproduce this with a minimal example, like I said I was using default config example and it was working fine in a new project, the issue was withing my project setup.

Copy link
Contributor

github-actions bot commented Jan 8, 2024

This issue has been locked since it has been closed for more than 14 days.

If you found a concrete bug or regression related to it, please open a new bug report with a reproduction against the latest wagmi version. If you have any other comments you can create a new discussion.

@github-actions github-actions bot locked and limited conversation to collaborators Jan 8, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Needs Reproduction Misc: Needs Reproduction
Projects
None yet
Development

No branches or pull requests

2 participants