ember-fetch: fetch is not defined - maybe your browser targets are not covering everything you need
I believe I have tracked the issue down to https://github.com/github/fetch. In version 3.1.1 it used to contain this https://github.com/github/fetch/blob/v3.1.1/fetch.js#L546 but in 3.2.0 it now contains this https://github.com/github/fetch/blob/v3.2.0/fetch.js#L564
Ember-fetch contains this check https://github.com/ember-cli/ember-fetch/blob/master/assets/browser-fetch.js.t#L36. I believe the module body here https://github.com/ember-cli/ember-fetch/blob/master/assets/browser-fetch.js.t#L34 injects the fetch library somehow. Ember-fetch is checking self and I think it now needs to check global maybe. Since this happened so long ago I dont know what dependencies have changed to make it fail for me now, but it failed today for me in multiple unrelated projects.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 4
- Comments: 31 (9 by maintainers)
Commits related to this issue
- Set fixed version for whatwg-fetch See https://github.com/ember-cli/ember-fetch/issues/547 — committed to lblod/frontend-loket by erikap 4 years ago
- 3.0: Drop support for Ember pre-2.4 Also drop un-used XHR mocking dependencies, and pin a dependency of ember-cli-addon-docs per https://github.com/ember-cli/ember-fetch/issues/547 (which could alter... — committed to Addepar/ember-table by mixonic 4 years ago
- 3.0: Drop support for Ember pre-2.4 Also drop un-used XHR mocking dependencies, and pin a dependency of ember-cli-addon-docs per https://github.com/ember-cli/ember-fetch/issues/547 (which could alter... — committed to Addepar/ember-table by mixonic 4 years ago
- 3.0: Drop support for Ember pre-2.4 Also drop un-used XHR mocking dependencies, and pin a dependency of ember-cli-addon-docs per https://github.com/ember-cli/ember-fetch/issues/547 (which could alter... — committed to Addepar/ember-table by mixonic 4 years ago
- [tests] Fix undefined `fetch` error for 'floating dependencies' Pin whatwg-fetch dependence to '3.3.1'. This fixes an error "fetch is not defined - maybe your browser targets are not covering everyt... — committed to Addepar/ember-table by bantic 4 years ago
- [tests] Fix undefined `fetch` error for 'floating dependencies' Pin whatwg-fetch dependence to '3.3.1'. This fixes an error "fetch is not defined - maybe your browser targets are not covering everyt... — committed to Addepar/ember-table by bantic 4 years ago
- [tests] Fix undefined `fetch` error for 'floating dependencies' Pin whatwg-fetch dependence to '3.3.1'. This fixes an error "fetch is not defined - maybe your browser targets are not covering everyt... — committed to Addepar/ember-table by bantic 4 years ago
- 3.0: Drop support for Ember pre-2.4 Also drop un-used XHR mocking dependencies, and pin a dependency of ember-cli-addon-docs per https://github.com/ember-cli/ember-fetch/issues/547 (which could alter... — committed to Addepar/ember-table by mixonic 4 years ago
- 3.0: Drop support for Ember pre-2.4 Also drop un-used XHR mocking dependencies, and pin a dependency of ember-cli-addon-docs per https://github.com/ember-cli/ember-fetch/issues/547 (which could alter... — committed to NullVoxPopuli/ember-table by mixonic 4 years ago
- 3.0: Drop support for Ember pre-2.4 Also drop un-used XHR mocking dependencies, and pin a dependency of ember-cli-addon-docs per https://github.com/ember-cli/ember-fetch/issues/547 (which could alter... — committed to johanrd/ember-table by mixonic 4 years ago
- Pin whatwg-fetch to 3.3.1 to avoid issues with global detection. This was fixed in ember-fetch@8.0.2 but we are stuck using ember-fetch@6 (due to Node version compat). This works around the issue. S... — committed to emberjs/ember-test-helpers by rwjblue 3 years ago
- Pinned a few packages so that floating dependency builds don't break ember-data: Too permissive. The latest version 3.26 was being installed. Incompatible with the existing setup whatwg-fetch: Incom... — committed to adopted-ember-addons/ember-file-upload by gilest 3 years ago
- Pinned a few packages so that floating dependency builds don't break ember-data: Too permissive. The latest version 3.26 was being installed. Incompatible with the existing setup whatwg-fetch: Incom... — committed to adopted-ember-addons/ember-file-upload by gilest 3 years ago
- Pinned a few packages so that floating dependency builds don't break (#431) As sub-dependencies out in the wild have been updated they have caused the "Floating Dependencies" builds to fail. ember... — committed to adopted-ember-addons/ember-file-upload by gilest 3 years ago
- Upgrade ember-fetch & ember-simple-auth (see description) Known issue breaks app but can be resolved by upgrading: https://github.com/ember-cli/ember-fetch/issues/547 — committed to lblod/frontend-dashboard by aatauil 3 years ago
Hey, turns out I was using
ember-simple-authversion 2.1.0, which uses an older version ofember-fetch. I was able to fix the issue by upgradingember-simple-authAll of my addons have started failing with
Error: fetch is not defined - maybe your browser targets are not covering everything you need?. What’s the workaround?I’m using ember-fetch 8.0.4 and still have this issue.
Failing for 8.0.2 as well https://github.com/fossasia/open-event-frontend/pull/4732/files https://travis-ci.com/github/fossasia/open-event-frontend/builds/179380414
The tutorial builds are failing as well: https://github.com/ember-learn/super-rentals-tutorial/actions/runs/199896721
This addon docs PR is currently throwing the error https://github.com/ember-learn/ember-cli-addon-docs/pull/495
If your using
yarnadd this to yourpackage.jsonLooks like new release 3.4.0 of
whatwg-fetchbreaks ember-fetch