Closed kohei-takata closed 8 years ago
I tried adding "babel": "^5.8.23" to dependencies of package.json in learnyoureact. After running npm install under node_modules/learnyoureact/, I run "learnyoureact verify program.js" and got following result.
1. ACTUAL: "<!DOCTYPE html>"
1. EXPECTED: "SyntaxError: Unexpected reserved word"
2. ACTUAL: "<div class=\"todoBox\">Hello, world!</div>"
2. EXPECTED: "<br> at exports.runInThisContext (vm.js:53:16)"
3. ACTUAL: ""
3. EXPECTED: "<br> at Module._compile (module.js:414:25)"
4. ACTUAL:
4. EXPECTED: "<br> at Object.require.extensions.(anonymous function) [as .jsx] (/Users/kusanagi/.nvm/versions/node/v4.2.2/lib/node_modules/learnyoureact/node_modules/babel/node_modules/babel-core/lib/api/register/node.js:214:7)"
5. ACTUAL:
5. EXPECTED: "<br> at Module.load (module.js:356:32)"
6. ACTUAL:
6. EXPECTED: "<br> at Function.Module._load (module.js:311:12)"
7. ACTUAL:
7. EXPECTED: "<br> at Module.require (module.js:366:17)"
8. ACTUAL:
8. EXPECTED: "<br> at require (module.js:385:17)"
9. ACTUAL:
9. EXPECTED: "<br> at View.renderFile [as engine] (/Users/kusanagi/.nvm/versions/node/v4.2.2/lib/node_modules/learnyoureact/node_modules/express-react-views/index.js:43:23)"
10. ACTUAL:
10. EXPECTED: "<br> at View.render (/Users/kusanagi/.nvm/versions/node/v4.2.2/lib/node_modules/learnyoureact/node_modules/express/lib/view.js:93:8)"
11. ACTUAL:
11. EXPECTED: ""
I get the same error as xanagi too.
I think I can fix by changing like https://github.com/workshopper/learnyounode/commit/d583db654de953b988561a9601170ec6a4927b74 I will do tonight.
@xanagi @peterlazar1993 Thank you for your comment! I changed some codes. I think it will work correctly. Could you use v0.10.0-patched and give feedback to me? If the version work correctly, I will merge to master.
Hi @kohei-takata,
I tried your change of code here: https://github.com/kohei-takata/learnyoureact/blob/fix_timeout_bug/exercises/hello_react/exercise.js
And now the test seems to run, but I'm getting an error from the results:
$learnyoureact verify program.js
✗ ?exercises.HELLO_REACT.fail.connection || common.exercise.fail.connection?
Your submission results compared to the expected:
────────────────────────────────────────────────────────────────────────────────
1. ACTUAL: "<!DOCTYPE html>"
1. EXPECTED: ""
2. ACTUAL: "<div class=\"todoBox\">Hello, world!</div>"
2. EXPECTED:
────────────────────────────────────────────────────────────────────────────────
✗ Submission results did not match expected!
# FAIL
Your solution to HELLO_REACT didn't pass.
I got the same result as @scottnash.
@scottnath @xanagi Thanks for trying. I'll try to fix again.
@scottnath @xanagi How is this? https://github.com/kohei-takata/learnyoureact/blob/fix_timeout_bug/exercises/hello_react/exercise.js
@kohei-takata
These are the results I got:
<!DOCTYPE html>
<div class="todoBox">Hello, world!</div>%
✗ ?exercises.HELLO_REACT.fail.connection || common.exercise.fail.connection?
Your submission results compared to the expected:
────────────────────────────────────────────────────────────────────────────────
1. ACTUAL: "<!DOCTYPE html>"
1. EXPECTED: ""
────────────────────────────────────────────────────────────────────────────────
✗ Submission results did not match expected!
# FAIL
Your solution to HELLO_REACT didn't pass. Try again!
So, it seems the fail.connection
says it's still failing on finding the second port.
@kohei-takata
I got the completely same result as @scottnath.
It seems that the solution child process fails at 'require('babel/register')' in solution.js. I added the following lines to learnyoureact/node_modules/workshopper-exercise/execute.js around line 90.
this.solutionChild.stderr.on('data', function(data){
console.log('----------');
console.log(data.toString());
console.log('----------');
});
The output of verify was
$ learnyoureact verify program.js
----------
module.js:339
throw err;
^
Error: Cannot find module 'babel/register'
at Function.Module._resolveFilename (module.js:337:15)
at Function.Module._load (module.js:287:25)
at Module.require (module.js:366:17)
at require (module.js:385:17)
at Object.<anonymous> (/Users/kusanagi/.nodebrew/node/v4.2.2/lib/node_modules/learnyoureact/exercises/hello_react/solution/solution.js:9:1)
at Module._compile (module.js:435:26)
at Object.Module._extensions..js (module.js:442:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:311:12)
at Function.Module.runMain (module.js:467:10)
----------
✗ ?exercises.HELLO_REACT.fail.connection || common.exercise.fail.connection?
Your submission results compared to the expected:
────────────────────────────────────────────────────────────────────────────────
1. ACTUAL: "<!DOCTYPE html>"
1. EXPECTED: ""
2. ACTUAL: "<div class=\"todoBox\">Hello, world!</div>"
2. EXPECTED:
────────────────────────────────────────────────────────────────────────────────
✗ Submission results did not match expected!
# FAIL
Your solution to HELLO_REACT didn't pass. Try again!
@scottnath @xanagi This bug seems to be fixed by https://github.com/babel/babel/issues/1889. I will make a PR #75. After testing, I will merge that to master. Anyway, thanks for your testing and reporting.
@kohei-takata confirmed fix. thank you.
@scottnath I'm glad to hear that. Thank you for your report! :smile:
@kohei-takata
I confirmed fix too. Thanks!
@xanagi I'm glad to hear that! Thanks for your comment :smiley:
refs https://github.com/tako-black/learnyoureact/issues/22#issuecomment-153124021 Can I fix by this code? https://gist.github.com/martinheidegger/a7cf754d91f847c29965 I will try.