only-cliches / cpp-wasm-loader

C/C++ to WASM Webpack Loader

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

"window is not defined" error in webworkers

d07RiV opened this issue · comments

Trying to import a module in a web worker results in window is not defined error.

It is used in this line of minimal env:

	var globalEnv = {
		"global": window,
		"env": {

What's the purpose of it? As far as I can tell, nothing actually uses global env. But just in case, I replaced it with self if window is not defined.

PR: #11

PR has been accepted, I'll push a new release to NPM with those changes soon.

The PR is live as of 0.9.0.