Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

is Fastboot not support with Ember Data 5.0? #8667

Closed
st-h opened this issue Jul 3, 2023 · 1 comment
Closed

is Fastboot not support with Ember Data 5.0? #8667

st-h opened this issue Jul 3, 2023 · 1 comment

Comments

@st-h
Copy link

st-h commented Jul 3, 2023

I am upgrading an app that uses fastboot to Ember 5. As soon as I update Ember Data to 5.0, I see the following error in fastboot mode (regular mode works fine). Reverting Ember data to 4.x resolves the issue.

ReferenceError: AbortController is not defined
    at RequestManager.request (/var/folders/k0/gr21dt897rl512t16pr6fvwr0000gn/T/broccoli-70505mNywZsvAQIwR/out-734-broccoli_merge_trees/assets/addon-tree-output/@ember-data/request/index.js:722:1)
    at Store.request (/var/folders/k0/gr21dt897rl512t16pr6fvwr0000gn/T/broccoli-70505mNywZsvAQIwR/out-734-broccoli_merge_trees/assets/addon-tree-output/@ember-data/store/-private.js:3854:1)
    at Store.queryRecord (/var/folders/k0/gr21dt897rl512t16pr6fvwr0000gn/T/broccoli-70505mNywZsvAQIwR/out-734-broccoli_merge_trees/assets/addon-tree-output/@ember-data/store/-private.js:4810:1)

I found this issue #8475 with seems to be related. However, when I apply to proposed solution the error changes. Now I get that:

ReferenceError: XMLHttpRequest is not defined
    at eval (webpack://__ember_auto_import__/./node_modules/pretender/dist/pretender.es.js?:263:1886)
    at new Promise (<anonymous>)
    at fetch (webpack://__ember_auto_import__/./node_modules/pretender/dist/pretender.es.js?:263:1705)
    at Account._fetchRequest (/var/folders/k0/gr21dt897rl512t16pr6fvwr0000gn/T/broccoli-75229j4B3CjfqdF6a/out-734-broccoli_merge_trees/assets/addon-tree-output/@ember-data/adapter/rest.js:942:1)
    at Account.ajax (/var/folders/k0/gr21dt897rl512t16pr6fvwr0000gn/T/broccoli-75229j4B3CjfqdF6a/out-734-broccoli_merge_trees/assets/addon-tree-output/@ember-data/adapter/rest.js:908:1)

How do I make ember data 5.0 compatible with fastboot?

@runspired
Copy link
Contributor

runspired commented Jul 3, 2023

ReferenceError: AbortController is not defined

This is a bug in fastboot, but which apps can address by adding the global like you found.

ReferenceError: XMLHttpRequest is not defined

EmberData does nothing with XMLHttpRequest, and this stack trace suggests you are using pretender (which is used by mirage) which is probably where you need to be looking for a fix. I don't think node ever implemented this as a global but if it has then you could patch the same as AbortController, but it is also a bit surprising to not be using Fetch at this point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants