freeCodeCamp / freeCodeCamp/solana-curriculum

[BUG]: Learn How to Interact with On-Chain Programs - Step 43 - 44 - crash on code with errors

Open
#74 4 comments 0 reactions 0 assignees View on GitHub
patch type: bug
Dominant language
TypeScript
Stars
153
Forks
58
PR merge metrics
No merged PRs in 30d

Description

### Issue/Experience
During the run of tests on steps 43 and 44, server crashes if code has errors.

I had missing correct object creation when initially tried to run tests on step 43. This resulted in a crash:

>Error 4XX - 5XX
Client has disconnected from local server

Terminal output is included below.

The same error doesn't create issues elsewhere, I've tried in step 35 making similar error and there were no crashes. It's not specific for only that error, crash happens also ie. on `ReferenceError`. Similar situation is with step 44.

```
🔵 INFO: 2022-12-17 15:15:18 Listening on port 8080
🔵 INFO: 2022-12-17 15:15:19 Watching for file changes on /workspace/solana-curriculum
undefined:33
const instruction = TransactionInstruction(transaction);
^

TypeError: Class constructor TransactionInstruction cannot be invoked without 'new'
at sayHello (eval at (eval at (file:///workspace/solana-curriculum/.freeCodeCamp/tooling/test.js:93:35)), :33:23)
at eval (eval at (eval at (file:///workspace/solana-curriculum/.freeCodeCamp/tooling/test.js:93:35)), :36:1)
at eval (eval at (eval at (file:///workspace/solana-curriculum/.freeCodeCamp/tooling/test.js:93:35)), :38:3)
at eval (eval at (file:///workspace/solana-curriculum/.freeCodeCamp/tooling/test.js:93:35), :35:13)
at eval (eval at (file:///workspace/solana-curriculum/.freeCodeCamp/tooling/test.js:93:35), :44:3)
at file:///workspace/solana-curriculum/.freeCodeCamp/tooling/test.js:93:35
at Array.map ()
at runTests (file:///workspace/solana-curriculum/.freeCodeCamp/tooling/test.js:79:43)
at async FSWatcher. (file:///workspace/solana-curriculum/.freeCodeCamp/tooling/hot-reload.js:51:9)

Node.js v18.12.1
```

### Output of running `node tooling/camper-info.js` from the workspace root
🔵 INFO: Project: learn-how-to-interact-with-on-chain-programs
🔵 INFO: Lesson Number: 1
🔵 INFO: Curriculum Version: 0.1.2
🔵 INFO: freeCodeCamp - Courses: freeCodeCamp.freecodecamp-courses@1.7.1
🔵 INFO: Commit: 5526f1a chore(deps): update dependency @types/node to v18.11.13

🔵 INFO: OS Info:
Architecture: x64
Platform: linux
Release: 5.15.0-56-generic
Type: Linux

Contributor guide

Open the contributing guide

Research direction

Start with .freeCodeCamp/tooling/test.js around line 93 and .freeCodeCamp/tooling/hot-reload.js around line 51, then reproduce the crash by running tests for steps 43 and 44 with invalid code. Compare the behavior with step 35. Done means errors are reported without disconnecting the local server or crashing the test run.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js, typescript
Domain
testing, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.