Open multimeric opened 2 months ago
Hmph ..., this is not quite ideal, I switched the imports/requires from static to dynamic in order to simplify compatibility between environments ... I guess I'll have to split the files up somehow ... Could you check whether changing require("http") to require(/ webpackIgnore: true / "http"), both http and https should include it. In the meantime consider configuring webpack to ignore http
Could you check whether changing require("http") to require(/ webpackIgnore: true / "http"),
The only instance I could find was on node_modules/overpass-ql-ts/lib/cjs-bundle.cjs
line 2559, which I changed to:
const [http, https] = await Promise.all([Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(/* webpackIgnore: true */'http')); }), Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(/* webpackIgnore: true */'https')); })]);
Didn't seem to help though.
In the meantime consider configuring webpack to ignore http
Tricky to do because I'm using Create React App. I'd have to eject to access the config file I think.
Same with line 2537 of node_modules/overpass-ql-ts/lib/esm-bundle.mjs
, which I changed to:
const [http, https] = await Promise.all([import(/* webpackIgnore: true */ 'http'), import(/* webpackIgnore: true */ 'https')]);
Well, since its unlikely that you'd be using the node http adapter, you can comment these lines instead,
static async Load() {
//const [http, https] = await Promise.all([Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('http')); }), Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('https')); })]);
//this.Methods = [http.request, https.request];
this.Loaded = true;
delete this.LoadPromise;
}
Inexplicably, that doesn't work either. It must be caching something somewhere that I don't understand yet.
My intention is to use the fetch client:
However, this fails to compile. My guess is that even having the
require("http")
anywhere in the module triggers this.