This is NOT A BUG report. Rather a request to understand how to debug EJS templates using VScode debugger.
How does one debug EJS templates in VScode?
At the moment, I'm doing this "old school" with a bunch of console.info() statements that output variable names and values. This is not a long term solution as I will need to manually remove all these lines of code from the final product.
Supposedly, there is a way to do this in VScode by adding an "attach to node" process in the debugger via the .vscode/launch.json file. I've tried to do this with the following config, but all my breakpoints show "unbound" status. Any advice is appreciated.
After running hexo clean && node --inspect-brk=4001 ./node_modules/hexo-cli/bin/hexo server -p 4001 and starting the debugger, I see "Debugger listening on ..." and "Debugger attached."
VScode will stop the code and step through the nodeJS files within the node_modules folder, but still doesn't stop on breakpoints set within the EJS template files. What am I missing?
This is NOT A BUG report. Rather a request to understand how to debug EJS templates using VScode debugger.
How does one debug EJS templates in VScode?
At the moment, I'm doing this "old school" with a bunch of console.info() statements that output variable names and values. This is not a long term solution as I will need to manually remove all these lines of code from the final product. Supposedly, there is a way to do this in VScode by adding an "attach to node" process in the debugger via the
.vscode/launch.json
file. I've tried to do this with the following config, but all my breakpoints show "unbound" status. Any advice is appreciated.After running
hexo clean && node --inspect-brk=4001 ./node_modules/hexo-cli/bin/hexo server -p 4001
and starting the debugger, I see "Debugger listening on ..." and "Debugger attached."VScode will stop the code and step through the nodeJS files within the
node_modules
folder, but still doesn't stop on breakpoints set within the EJS template files. What am I missing?Reference
Related