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

Could not find module fetch imported from prog/instance-initializers/setup-fetch #442

Closed
e-monson opened this issue Feb 7, 2020 · 2 comments

Comments

@e-monson
Copy link

e-monson commented Feb 7, 2020

I am having an issue very similar to #166 , but my app is looking for fetch rather than fetch/setup:

Error: Could not find module `fetch` imported from `app/instance-initializers/setup-fetch`
    at missingModule (/tmp/broccoli-13892KvrrHFw87w7D/out-804-broccoli_merge_trees/assets/vendor/loader/loader.js:247:1)
    at findModule (/tmp/broccoli-13892KvrrHFw87w7D/out-804-broccoli_merge_trees/assets/vendor/loader/loader.js:258:1)
    at Module.findDeps (/tmp/broccoli-13892KvrrHFw87w7D/out-804-broccoli_merge_trees/assets/vendor/loader/loader.js:168:1)
    at findModule (/tmp/broccoli-13892KvrrHFw87w7D/out-804-broccoli_merge_trees/assets/vendor/loader/loader.js:262:1)
    at requireModule (/tmp/broccoli-13892KvrrHFw87w7D/out-804-broccoli_merge_trees/assets/vendor/loader/loader.js:24:1)
    at resolveInitializer (/tmp/broccoli-13892KvrrHFw87w7D/out-804-broccoli_merge_trees/assets/addon-tree-output/ember-load-initializers/index.js:34:1)
    at registerInstanceInitializers (/tmp/broccoli-13892KvrrHFw87w7D/out-804-broccoli_merge_trees/assets/addon-tree-output/ember-load-initializers/index.js:53:1)
    at exports.default (/tmp/broccoli-13892KvrrHFw87w7D/out-804-broccoli_merge_trees/assets/addon-tree-output/ember-load-initializers/index.js:29:1)
    at Module.callback (/tmp/broccoli-13892KvrrHFw87w7D/out-804-broccoli_merge_trees/assets/app/app.js:13:1)
    at Module.exports (/tmp/broccoli-13892KvrrHFw87w7D/out-804-broccoli_merge_trees/assets/vendor/loader/loader.js:106:1)
    at Module._reify (/tmp/broccoli-13892KvrrHFw87w7D/out-804-broccoli_merge_trees/assets/vendor/loader/loader.js:143:1)
    at Module.reify (/tmp/broccoli-13892KvrrHFw87w7D/out-804-broccoli_merge_trees/assets/vendor/loader/loader.js:130:1)
    at Module.exports (/tmp/broccoli-13892KvrrHFw87w7D/out-804-broccoli_merge_trees/assets/vendor/loader/loader.js:104:1)
    at Object.requireModule (/tmp/broccoli-13892KvrrHFw87w7D/out-804-broccoli_merge_trees/assets/vendor/loader/loader.js:27:1)
    at Object.<anonymous> (/home/me/app_dev/app/node_modules/fastboot/src/ember-app.js:213:18)
    at VMSandbox.run (/home/me/app_dev/app/node_modules/fastboot/src/vm-sandbox.js:18:15)
    at EmberApp.createEmberApp (/home/me/app_dev/app/node_modules/fastboot/src/ember-app.js:212:30)
    at EmberApp.retrieveSandboxedApp (/home/me/app_dev/app/node_modules/fastboot/src/ember-app.js:237:17)
    at new EmberApp (/home/me/app_dev/app/node_modules/fastboot/src/ember-app.js:61:21)
    at FastBoot._buildEmberApp (/home/me/app_dev/app/node_modules/fastboot/src/index.js:114:17)
    at new FastBoot (/home/me/app_dev/app/node_modules/fastboot/src/index.js:52:10)
    at /home/me/app_dev/app/node_modules/ember-cli-fastboot/index.js:330:29
    at Layer.handle [as handle_request] (/home/me/app_dev/app/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/home/me/app_dev/app/node_modules/express/lib/router/index.js:317:13)
    at /home/me/app_dev/app/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/home/me/app_dev/app/node_modules/express/lib/router/index.js:335:12)
    at next (/home/me/app_dev/app/node_modules/express/lib/router/index.js:275:10)
    at /home/me/app_dev/app/node_modules/ember-cli/lib/tasks/server/middleware/broccoli-watcher/index.js:54:11
    at watcher.then.errorHandler.buildError (/home/me/app_dev/app/node_modules/broccoli-middleware/lib/watcher-middleware.js:35:7)
    at tryCatcher (/home/me/app_dev/app/node_modules/ember-cli/node_modules/rsvp/dist/lib/rsvp/-internal.js:39:19)
    at invokeCallback (/home/me/app_dev/app/node_modules/ember-cli/node_modules/rsvp/dist/lib/rsvp/-internal.js:211:31)
    at /home/me/app_dev/app/node_modules/ember-cli/node_modules/rsvp/dist/lib/rsvp/then.js:26:14
    at flush (/home/me/app_dev/app/node_modules/ember-cli/node_modules/rsvp/dist/lib/rsvp/asap.js:80:5)
    at processTicksAndRejections (internal/process/task_queues.js:75:11)

I am using ember-simple-auth like the other poster, and it seems to be the only other dependency in my app that depends on ember-fetch. I've tried adding this snippet to my app's package.json, as suggested in the other issue, specifying ^6.2.0 and ^6.3.0, but it has not helped:

  "resolutions": {
    "ember-simple-auth/**/ember-fetch": "^6.2.0"
  }

I'm using:

  • ember-simple-auth 1.8.2
  • ember-cli-fastboot 2.2.1
  • ember 3.7.3
  • ember-cli 3.7.1
@xg-wang
Copy link
Member

xg-wang commented Feb 8, 2020

Your project is using Fastboot, please read "Use with Fastboot > top-level addon" section in Readme.
After ember-fetch@v7.0.0 there will be an error thrown with more actionable info 11d9d7e.

@e-monson
Copy link
Author

Thanks! Adding ember-fetch as a top-level dependency fixed it for me.

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