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

Problem with app scaffold #3630

Closed
matteyu opened this issue Aug 22, 2023 · 1 comment · Fixed by #3631
Closed

Problem with app scaffold #3630

matteyu opened this issue Aug 22, 2023 · 1 comment · Fixed by #3631
Labels
type:error Something isn't working

Comments

@matteyu
Copy link

matteyu commented Aug 22, 2023

Describe the bug
This is a three part problem

  • when scaffolding a react app (following this doc https://docs.ignite.com/clients/react), there is a step to generating the hooks required for the app. One of the hooks generated useIbcApplicationsTransferV1 are riddled with errors due to =** being generated with the hash, trace and denom variables. Also, there is a left over unused import of vue (considering it's not part of the dependencies).

Screenshot 2023-08-22 at 9 47 07 AM

  • scaffolding a vue application also results in the same errors above

  • the generated ts-client for the client instance is generated outside of the scaffolded app. Therefore, it either needs to be linked using npm link (which needs to be done manually) or you transfer the ts-client directory that has been generated into the scaffolded app directory. If not done automatically, maybe good to add in docs for this step.

To reproduce
Steps to reproduce the behavior:

  1. scaffold a react or vue application
  2. generate hooks or composables
  3. run npm install to get the deps
  4. run npm run dev
  5. application should fail to build/run due to errors noted in the bug section

What version are you using?

Ignite CLI version: v0.27.1

@matteyu matteyu added the type:error Something isn't working label Aug 22, 2023
@clockworkgr
Copy link
Collaborator

Describe the bug This is a three part problem

  • when scaffolding a react app (following this doc https://docs.ignite.com/clients/react), there is a step to generating the hooks required for the app. One of the hooks generated useIbcApplicationsTransferV1 are riddled with errors due to =** being generated with the hash, trace and denom variables. Also, there is a left over unused import of vue (considering it's not part of the dependencies).

Screenshot 2023-08-22 at 9 47 07 AM

  • scaffolding a vue application also results in the same errors above

The "=**" issue should have been fixed with: #3592

I'll see if there was a regression of sorts.

Added a PR to remove the unnecessary type import here: #3631

  • the generated ts-client for the client instance is generated outside of the scaffolded app. Therefore, it either needs to be linked using npm link (which needs to be done manually) or you transfer the ts-client directory that has been generated into the scaffolded app directory. If not done automatically, maybe good to add in docs for this step.

The user is notified of this when running npm run dev.
.
When you generate hooks (or composables in vue's case) the package.json in the react or vue template scaffold is modified to add a dependency to the generated ts-client pointing to file:xxxxxx in the local filesystem. Thus no need to run npm link.

The postinstall script (https://github.com/ignite/web/blob/develop/packages/react-template/postinstall.cjs ) will run npm install for the ts-client to ensure its own deps are present, while the prepare script (when running npm run dev: https://github.com/ignite/web/blob/develop/packages/react-template/prepare.cjs) lets you know that you're running with a local version of the ts-client that should eventually be published and the entry in package.json updated to reflect that.

To reproduce Steps to reproduce the behavior:

  1. scaffold a react or vue application
  2. generate hooks or composables
  3. run npm install to get the deps
  4. run npm run dev
  5. application should fail to build/run due to errors noted in the bug section

What version are you using?

Ignite CLI version: v0.27.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:error Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants