How to debug in Chrome console in Meteor 1.3?

Since Meteor 1.3 uses modules, I could have a function like this:

function x() { /* whatever */ }

But I’m no longer able to access it in the Chrome console for testing/debugging purposes, and I can’t use import to pull it in. Does anyone have any suggestions on how to temporarily expose certain functions and variables so the browser can interact with them?

You can try putting them on the window object explicitly

require('/your/module') is globally available. You can use that to require your modules using absolute paths.

1 Like

Nothing worked. Any suggestions?

In your app code:

function foo(){}
window.foo = foo

Now you can access foo in the console.

foo()
1 Like

What beta version are you on?

Ah yes, I did something dumb. It works now! Now I just need to figure out how to access my collection in meteor shell and I’m set :smile: