-
-
Notifications
You must be signed in to change notification settings - Fork 80
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
Could not find module fetch/setup
imported from prog/instance-initializers/setup-fetch
#166
Comments
Hi @lougreenwood what is your Pember and fastboot version? |
@xg-wang I get the same error, I do not use Prember only fastboot 2.0.0. |
@davidbilling Were you trying to make a |
@xg-wang Not sure of the run-loop scoop of instance initialazer. My first fetch is directly when the page is loaded though. But I have not made any own instance initialaziers. |
hey @xg-wang - I'm using:
|
@lougreenwood @davidbilling Do you have reproduction steps? |
For me, this happens when doing an As a side note, 6.2 works fine in the same codebase with I'm also using |
@lougreenwood Does 6.1.1 has same issue? |
Pretty sure it’s some of the app’s dependency has a ember-fetch with different version and public/fastboot-fetch.js got overwritten |
@xg-wang I think you're right, seems that the problem is
|
@xg-wang @lougreenwood "resolutions" did not work for me. But I also have "ember-power-select" that uses ember-fetch 3.4.5 and other addons with ember-fetch. I will try to make a better test when I got more time. |
I'm also getting this error, via the To reproduce:
I think |
I also got this error and I think that's because you have an instance initializer that calls fetch before fetch could be set up. In my case, I called the current-user service which imported Here's the fix that worked for me: // app/instance-initializers/current-user.js
export function initialize(appInstance) {
let session = appInstance.lookup('service:session');
let currentUser = appInstance.lookup('service:current-user');
session.on('authenticationSucceeded', function() {
currentUser.load();
});
session.on('invalidationSucceeded', function() {
currentUser.unload();
});
}
const exportObject = {
initialize
}
if (typeof FastBoot !== 'undefined') {
exportObject.after = 'fetch';
}
export default exportObject; |
Released as v6.2.3. Feel free to reopen if this is still an issue. |
This release introduced a regression in my app. The following code works in v6.2.2 but breaks in v6.2.3: // app/instance-initializers/current-user.js
export function initialize(appInstance) {
let session = appInstance.lookup('service:session');
let currentUser = appInstance.lookup('service:current-user');
session.on('authenticationSucceeded', function() {
currentUser.load();
});
session.on('invalidationSucceeded', function() {
currentUser.unload();
});
}
const exportObject = {
initialize
}
if (typeof FastBoot !== 'undefined') {
exportObject.after = 'fetch';
}
export default exportObject; ( The error I get is
Am I doing something wrong? |
@balinterdi 🤔 |
I think I same the same issue when I upgraded to 6.3.0, it was the same incompatibility with IIRC, adding this to "resolutions": {
"ember-simple-auth/**/ember-fetch": "^6.3.0"
} |
@xg-wang I didn't invoke @lougreenwood ember-simple-auth extended the range of acceptable ember-fetch versions in this commit, did you try and see if you need the explicit resolution with ESA master? |
@balinterdi sure did, I actually submitted a PR before this commit - I was using my fork for my PR: Not sure why my fork stopped working but resolutions fixed it for me |
@balinterdi Do you think it could be node_modules cache issue? Seems you don't see it anymore when you test it again. |
@xg-wang Sorry, I no longer remember exactly what I did so that it started working. I don't recall doing anything in particular but it's possible that I removed node_modules and ran |
Hello, I'm getting the following build error on my CI server. Downgrading to 5.1 (before
/instance-initializers/setup-fetch
was introduced) fixes the issue.The text was updated successfully, but these errors were encountered: