Closed bertdeblock closed 10 months ago
Yeah, the issue is with return importSync('fetch').default.default;
. The double default isn't right / a bug I think, but seems to be the only way to get the equivalent of import fetch from 'fetch';
in a classic build, but this fails under Embroider. A similar issue was created here: https://github.com/embroider-build/embroider/issues/1203.
Possible workaround:
if (macroCondition(dependencySatisfies('ember-fetch', '^8.0.0'))) {
const emberFetch = importSync('fetch');
return emberFetch.default.default || emberFetch.default;
}
but doesn't really feel right 😄.
@bertdeblock Changes look good so far, however, tests for embroider-optimized are failing, can you take a look at that?