š `console.log` not working in player.js
See original GitHub issueEnvironment
System:
OS: Windows 10
CPU: x64 Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz
Memory: 8.48 GB / 15.86 GB
Binaries:
Yarn: 1.5.1 - ~\AppData\Roaming\npm\yarn.CMD
npm: 5.7.1 - C:\Program Files\nodejs\npm.CMD
Virtualization:
Docker: 18.03.0 - C:\Program Files\Docker\Docker\Resources\bin\docker.EXE
IDEs:
VSCode: 1.23.1 - C:\Program Files\Microsoft VS Code\bin\code.CMD
Languages:
Bash: 4.4.12 - C:\Program Files\Git\usr\bin\bash.EXE
Python: 2.7.14 - /c/Python27/python
Browsers:
Edge: 42.17666.1000.0
Internet Explorer: 11.0.17666.1000
Steps to reproduce
- Install warriorjs
npm i -g warriorjs
- Bootstrap with warriorjs
warriorjs
(follow default config)
- Open
Player.js
and add aconsole.log('hello')
statement in theplayTurn
method
playTurn () { console.log('Hello World'); }
- Run warriorjs
warriorjs
(select your character to run)
- The log is not displayed
Expected Behavior
All console
statements should be displayed in the output (or at least logged to a file).
Actual Behavior
No console
statements display.
Additional Notes
So far I think the issue comes from running in a new vm context. That call happens here: https://github.com/olistic/warriorjs/blob/master/packages/warriorjs-core/src/PlayerLoader.js#L23
And finally, this is a really cool project. Thanks to everyone for the great work so far!
Issue Analytics
- State:
- Created 5 years ago
- Reactions:3
- Comments:14 (7 by maintainers)
Top Results From Across the Web
Console.log not working at all - Stack Overflow
To solve it I opened the Developer Console (in Chrome), right clicked on the reload arrow next to the URL bar and selected...
Read more >What went wrong? Troubleshooting JavaScript - MDN Web Docs
Go to the tab that you've got number-game-errors.html open in, and open your JavaScript console. You should see an error message along theĀ ......
Read more >View log messages in Console on Mac - Apple Support
Use Console on your Mac to view the log messages collected by your computer and connected devices.
Read more >The ultimate guide to JavaScript console log - VitaminDev
Just like logging an error, to log an exception use the console.error function. try { throw newĀ ...
Read more >Concepts: JavaScript Debugging Basics - Brightcove
The console object has several methods, including: The log() method for general output of logging information. This allows string substitutionĀ ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
WarriorJS v0.3.0 includes a
think
ability that can be used as an alternative forconsole.log
. Itās not perfect yet, but I think itās good enough for now. Let me know if you have any feedback, Iām closing this ticket now.I found using the debugger super helpful.
Itās easiest with a local npm install:
and then add an index.js as follows
now you can debug with:
node --inspect-brk index.js
- just drop a debugger in player.js and play around with the commands.