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

fix: fuels dev hangs after compilation errors #3504

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

Dhaiwat10
Copy link
Member

@Dhaiwat10 Dhaiwat10 commented Dec 26, 2024

Release notes

In this release, we:

  • Fixed a bug where fuels dev would hang after a Sway compilation error

Summary

This PR fixes the issue where fuels dev would hang after a Sway compilation error.

To test:

  1. pnpm create fuels@pr-3504
  2. Run pnpm fuels:dev and pnpm dev
  3. Edit the contract and make sure it fails to compile
  4. Now edit the contract again and check if the contract works fine on the UI (it should work fine)

Checklist

  • All changes are covered by tests (or not applicable)
  • All changes are documented (or not applicable)
  • I reviewed the entire PR myself (preferably, on GH UI)
  • I described all Breaking Changes (or there's none)

Copy link

vercel bot commented Dec 26, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
fuels-template ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 27, 2024 3:49pm
ts-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 27, 2024 3:49pm
ts-docs-api ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 27, 2024 3:49pm

Copy link
Contributor

github-actions bot commented Dec 26, 2024

This PR is published in NPM with version 0.0.0-pr-3504-20241227154428

Copy link

codspeed-hq bot commented Dec 26, 2024

CodSpeed Performance Report

Merging #3504 will degrade performances by 48.39%

Comparing dp/fuels-dev-hang (4319dd1) with master (41c72fb)

Summary

❌ 1 regressions
✅ 17 untouched benchmarks

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Benchmarks breakdown

Benchmark master dp/fuels-dev-hang Change
should successfully conduct a custom transfer between wallets (x20 times) 50.3 ms 97.4 ms -48.39%

@Dhaiwat10 Dhaiwat10 marked this pull request as ready for review December 26, 2024 17:11
// because forc logs out 'Aborting due to 2 compilation errors' etc.
onForcError(reject);
}
});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried compiling an invalid project with forc build and it exited with an error code 1, so it seems to me that we shouldn't be parsing forc logs but rather just throwing if forc build exits with a non-zero code. Line 37: forc.on('error', onError) should've caught this but it didn't 🤔 Did you investigate this avenue?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

forc.on('error, onError) doesn't do anything because forc sends error messages to stdErr alongside other normal logs

Copy link
Contributor

Coverage Report:

Lines Branches Functions Statements
76.33%(+0%) 69.78%(-0.06%) 74.23%(+0.03%) 76.34%(+0%)
Changed Files:
Ok File (✨=New File) Lines Branches Functions Statements
🔴 packages/account/src/providers/transaction-request/transaction-request.ts 88.57%
(+0%)
76.71%
(-1.37%)
84%
(+0%)
88.81%
(+0%)
🔴 packages/fuels/src/cli/commands/build/buildSwayProgram.ts 94.11%
(-5.89%)
83.33%
(-16.67%)
100%
(+0%)
94.44%
(-5.56%)
🔴 packages/fuels/src/cli/commands/dev/index.ts 97.72%
(-2.28%)
75%
(-25%)
100%
(+0%)
97.91%
(-2.09%)

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

Successfully merging this pull request may close these issues.

Command fuels dev hangs on generating types
2 participants