1

I am trying a component inside runkit.com. As it is visible from the image, the platform tells me ...

Fix: Use global instead of window. RunKit is a node environment, so window and other browser features won’t exist. If you’re just trying to access the global object, you can simply use global instead.

This is the code pasted:

var window = {};
const QueryQl = require("queryfilters/queryql")
var q = new QueryQl();
q.json({
    'ciao': 'mondo'
});
q.getQueryString();

Fix: Use global instead of window.

How can I fix this?

sensorario
  • 20,262
  • 30
  • 97
  • 159

2 Answers2

1

The fix is simple. Just replace this

window.module = window.module || {};

with this:

global.module = global.module || {};

in the module.

sensorario
  • 20,262
  • 30
  • 97
  • 159
0

Try to define window to the global, Before calling the module:

global.window = {}