Everytime I click the Run Tests button it seems to die with the following error:
Restarting using npm run dev:curriculum && npm run start doesn’t seem to help either.
Any ideas?
Listening on port 8080
node:fs:1392
handleErrorFromBinding(ctx);
^
'project-euler no such file or directory, scandir './tooling/locales/english
at Object.readdirSync (node:fs:1392:3)
at getLessonFromDirectory (/home/camper/curriculum/.freeCodeCamp/tooling/parser.js:30:6)
at runLesson (/home/camper/curriculum/.freeCodeCamp/tooling/lesson.js:14:18)
at handleConnect (/home/camper/curriculum/.freeCodeCamp/tooling/server.js:40:3)
at Object.connect (/home/camper/curriculum/.freeCodeCamp/tooling/server.js:49:5)
at WebSocket.message (/home/camper/curriculum/.freeCodeCamp/tooling/server.js:62:31)
at WebSocket.emit (node:events:526:28)
at Receiver.receiverOnMessage (/home/camper/curriculum/.freeCodeCamp/node_modules/ws/lib/websocket.js:1137:20)
at Receiver.emit (node:events:526:28)
at Receiver.dataMessage (/home/camper/curriculum/.freeCodeCamp/node_modules/ws/lib/receiver.js:528:14) {
errno: -2,
syscall: 'scandir',
code: 'ENOENT',
path: './tooling/locales/english\r/project-euler\r'
}
Clicking Run Tests doesn’t do anything - produces error in console output
Failure Information
node:fs:1392
handleErrorFromBinding(ctx);
^
'project-euler no such file or directory, scandir './tooling/locales/english
at Object.readdirSync (node:fs:1392:3)
at getLessonFromDirectory (/home/camper/curriculum/.freeCodeCamp/tooling/parser.js:30:6)
at runLesson (/home/camper/curriculum/.freeCodeCamp/tooling/lesson.js:14:18)
at handleConnect (/home/camper/curriculum/.freeCodeCamp/tooling/server.js:40:3)
at Object.connect (/home/camper/curriculum/.freeCodeCamp/tooling/server.js:49:5)
at WebSocket.message (/home/camper/curriculum/.freeCodeCamp/tooling/server.js:62:31)
at WebSocket.emit (node:events:526:28)
at Receiver.receiverOnMessage (/home/camper/curriculum/.freeCodeCamp/node_modules/ws/lib/websocket.js:1137:20)
at Receiver.emit (node:events:526:28)
at Receiver.dataMessage (/home/camper/curriculum/.freeCodeCamp/node_modules/ws/lib/receiver.js:528:14) {
errno: -2,
syscall: 'scandir',
code: 'ENOENT',
path: './tooling/locales/english\r/project-euler\r'
}
Steps to Reproduce
Install VSCode plugins and bring up Project Euler docker container
Modify src/lib.rs
Build project via npm run build
Click Run Tests in browser window (preview or separate)
Environment
Host OS: Windows 11 (x64)
Applications: VS Code (w/plugins), Docker
Failure Logs
See above for error output
npm run dev:curriculum && npm run start doesn’t resolve the issue
<ctrl> + <shift> + <p> - select freeCodeCamp: Run Course
npm run build (see output below - seems like the WASM was built correctly)
??? <— it’s quite possible I’m missing something
root@e067846eeaae:/home/camper/curriculum# npm run build
> curriculum@1.0.0 build
> wasm-pack build && npm run webpack-build
[INFO]: Checking for the Wasm target...
[INFO]: Compiling to Wasm...
Finished release [optimized] target(s) in 0.00s
[INFO]: Installing wasm-bindgen...
[INFO]: Optimizing wasm binaries with `wasm-opt`...
[INFO]: Optional fields missing from Cargo.toml: 'description', 'repository', and 'license'. These are not necessary, but recommended
[INFO]: :-) Done in 0.32s
[INFO]: :-) Your wasm pkg is ready to publish at /home/camper/curriculum/pkg.
> curriculum@1.0.0 webpack-build
> webpack --config webpack.config.js
assets by status 13.1 KiB [cached] 1 asset
asset bundle.js 9.25 KiB [compared for emit] (name: main)
runtime modules 3.76 KiB 6 modules
cacheable modules 243 bytes (javascript) 13.1 KiB (webassembly)
./pkg/curriculum_bg.js 193 bytes [built] [code generated]
./pkg/curriculum_bg.wasm 50 bytes (javascript) 13.1 KiB (webassembly) [built] [code generated]
webpack 5.72.0 compiled successfully in 96 ms
source (please don’t judge - still learning):
use wasm_bindgen::prelude::*;
// // Example format to write functions:
// #[wasm_bindgen(js_name = camelCaseName)] // js_name must equal function name tested on client
// pub fn snake_case_name(num: i32) -> i32 { // Function must be public
// // All numbers in JS are 32-bit
// num
// }
// First function written for you - you still need to add the logic :)
#[wasm_bindgen(js_name = multiplesOf3and5)]
pub fn multiples_of_3_and_5(n: i32) -> i32 {
let mut acc_3 = vec![];
let mut acc_5 = vec![];
let mut acc_15 = vec![];
for num in 1..n {
if num % 3 == 0 && num % 5 == 0 {
acc_15.push(num);
} else if num % 3 == 0 {
acc_3.push(num);
} else if num % 5 == 0 {
acc_5.push(num);
}
}
acc_3.iter().sum::<i32>() +
acc_5.iter().sum::<i32>() +
acc_15.iter().sum::<i32>()
}
Not sure if it helps or not, but here is what inspect on the page says on button click:
DevTools failed to load source map: Could not load content for http://localhost:8080/requestProvider.js.map: Load canceled due to load timeout
index.js:97 WebSocket is already in CLOSING or CLOSED state.
sock @ index.js:97
runTests @ index.js:28
onclick @ (index):44
Maybe whatever that error says is killing the server listening on 8080 and closing the socket.
I am not able to see anything that stands out as being a problem.
My best suggestion at the moment is to rebuild another container - delete the first container, and/or ensure to use Remote-Containers: Rebuild Container without Cache (not necessarily exact - I am doing this from memory)
Otherwise, I suggest you try one of the other methods to run the course.