2021年4月7日星期三

Webpack'd oboe module will not run

I've compiled a project using webpack, which among its dependencies has oboe. After including the compiled project as a dependency in a node project, and starting it up with npm run dev, I get this error:

/usr/src/app/node_modules/@myproject/blockchain/lib/@myproject/blockchain.js:37762           return self;           ^    ReferenceError: self is not defined  

Looking at that bit of code in the compiled project, I find

// Access to the window object throws an exception in HTML5 web workers so  // point it to "self" if it runs in a web worker  try {      return window;  } catch (e) {      return self;  }  

Seems like this is some kind of feature of Webpack, but I'm not sure how to cope with it. I found this thread, but looking at my current configuration for globalObject:

globalObject: 'typeof self !== \'undefined\' ? self : this'  

that does not seem to be the right answer. I looked through the output configuration of Webpack, but not sure what I'm looking for.

https://stackoverflow.com/questions/66996403/webpackd-oboe-module-will-not-run April 08, 2021 at 10:07AM

没有评论:

发表评论