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

Fastboot service initialization fails when using Embroider and storeConfigInMeta is disabled #863

Open
rahulk94 opened this issue Nov 25, 2021 · 0 comments

Comments

@rahulk94
Copy link
Contributor

I've run across an issue where if you are using a 3.2.x series of ember-cli-fastboot with Embroider and the storeConfigInMeta configuration option enabled in your ember-cli-build.js, the initialization of the Fastboot service fails. This looks to be an timing or dependency issue between the initialization of ember-fetch and ember-cli-fastboot.

TypeError: Cannot read property 'method' of undefined
    at Class.init (webpack:///./node_modules/ember-cli-fastboot/services/fastboot.js?:9:27)
    at Class.superWrapper [as init] (/var/folders/_b/525y2kfj6sg6l_gbcnf29qsm0000gp/T/broccoli-24537nrIycI2Y4tbE/out-239-packager_runner_embroider_webpack/assets/@ember/-internals/utils/index.js:442:1)
    at initialize (/var/folders/_b/525y2kfj6sg6l_gbcnf29qsm0000gp/T/broccoli-24537nrIycI2Y4tbE/out-239-packager_runner_embroider_webpack/assets/@ember/-internals/runtime/lib/system/core_object.js:88:1)
    at Function.create (/var/folders/_b/525y2kfj6sg6l_gbcnf29qsm0000gp/T/broccoli-24537nrIycI2Y4tbE/out-239-packager_runner_embroider_webpack/assets/@ember/-internals/runtime/lib/system/core_object.js:604:1)
    at Class.eval (webpack:///./node_modules/ember-cli-fastboot/services/fastboot.js?:105:26)
    at /var/folders/_b/525y2kfj6sg6l_gbcnf29qsm0000gp/T/broccoli-24537nrIycI2Y4tbE/out-239-packager_runner_embroider_webpack/assets/@ember/-internals/metal/index.js:1918:1
    at untrack (/var/folders/_b/525y2kfj6sg6l_gbcnf29qsm0000gp/T/broccoli-24537nrIycI2Y4tbE/out-239-packager_runner_embroider_webpack/assets/@glimmer/validator.js:842:1)
    at ComputedProperty.get (/var/folders/_b/525y2kfj6sg6l_gbcnf29qsm0000gp/T/broccoli-24537nrIycI2Y4tbE/out-239-packager_runner_embroider_webpack/assets/@ember/-internals/metal/index.js:1917:1)
    at Class.getter [as request] (/var/folders/_b/525y2kfj6sg6l_gbcnf29qsm0000gp/T/broccoli-24537nrIycI2Y4tbE/out-239-packager_runner_embroider_webpack/assets/@ember/-internals/metal/index.js:1007:1)
    at getPossibleMandatoryProxyValue (/var/folders/_b/525y2kfj6sg6l_gbcnf29qsm0000gp/T/broccoli-24537nrIycI2Y4tbE/out-239-packager_runner_embroider_webpack/assets/@ember/-internals/metal/index.js:1308:1)
    at _getProp (/var/folders/_b/525y2kfj6sg6l_gbcnf29qsm0000gp/T/broccoli-24537nrIycI2Y4tbE/out-239-packager_runner_embroider_webpack/assets/@ember/-internals/metal/index.js:1373:1)
    at get (/var/folders/_b/525y2kfj6sg6l_gbcnf29qsm0000gp/T/broccoli-24537nrIycI2Y4tbE/out-239-packager_runner_embroider_webpack/assets/@ember/-internals/metal/index.js:1359:1)
    at Class.get (/var/folders/_b/525y2kfj6sg6l_gbcnf29qsm0000gp/T/broccoli-24537nrIycI2Y4tbE/out-239-packager_runner_embroider_webpack/assets/@ember/-internals/runtime/lib/mixins/observable.js:116:1)
    at Object.patchFetchForRelativeURLs [as initialize] (webpack:///./instance-initializers/setup-fetch.js?:13:140)
    at /var/folders/_b/525y2kfj6sg6l_gbcnf29qsm0000gp/T/broccoli-24537nrIycI2Y4tbE/out-239-packager_runner_embroider_webpack/assets/@ember/engine/index.js:136:1
    at Vertices.each (/var/folders/_b/525y2kfj6sg6l_gbcnf29qsm0000gp/T/broccoli-24537nrIycI2Y4tbE/out-239-packager_runner_embroider_webpack/assets/dag-map.js:231:1)
    at Vertices.walk (/var/folders/_b/525y2kfj6sg6l_gbcnf29qsm0000gp/T/broccoli-24537nrIycI2Y4tbE/out-239-packager_runner_embroider_webpack/assets/dag-map.js:145:1)
    at DAG.each (/var/folders/_b/525y2kfj6sg6l_gbcnf29qsm0000gp/T/broccoli-24537nrIycI2Y4tbE/out-239-packager_runner_embroider_webpack/assets/dag-map.js:75:1)
    at DAG.topsort (/var/folders/_b/525y2kfj6sg6l_gbcnf29qsm0000gp/T/broccoli-24537nrIycI2Y4tbE/out-239-packager_runner_embroider_webpack/assets/dag-map.js:83:1)
    at App._runInitializer (/var/folders/_b/525y2kfj6sg6l_gbcnf29qsm0000gp/T/broccoli-24537nrIycI2Y4tbE/out-239-packager_runner_embroider_webpack/assets/@ember/engine/index.js:151:1)
    at App.runInstanceInitializers (/var/folders/_b/525y2kfj6sg6l_gbcnf29qsm0000gp/T/broccoli-24537nrIycI2Y4tbE/out-239-packager_runner_embroider_webpack/assets/@ember/engine/index.js:134:1)
    at Class._bootSync (/var/folders/_b/525y2kfj6sg6l_gbcnf29qsm0000gp/T/broccoli-24537nrIycI2Y4tbE/out-239-packager_runner_embroider_webpack/assets/@ember/application/instance.js:111:1)
    at App.didBecomeReady (/var/folders/_b/525y2kfj6sg6l_gbcnf29qsm0000gp/T/broccoli-24537nrIycI2Y4tbE/out-239-packager_runner_embroider_webpack/assets/@ember/application/lib/application.js:706:1)
    at invokeWithOnError (/var/folders/_b/525y2kfj6sg6l_gbcnf29qsm0000gp/T/broccoli-24537nrIycI2Y4tbE/out-239-packager_runner_embroider_webpack/assets/backburner.js:347:1)
    at Queue.flush (/var/folders/_b/525y2kfj6sg6l_gbcnf29qsm0000gp/T/broccoli-24537nrIycI2Y4tbE/out-239-packager_runner_embroider_webpack/assets/backburner.js:229:1)
    at DeferredActionQueues.flush (/var/folders/_b/525y2kfj6sg6l_gbcnf29qsm0000gp/T/broccoli-24537nrIycI2Y4tbE/out-239-packager_runner_embroider_webpack/assets/backburner.js:426:1)
    at Backburner._end (/var/folders/_b/525y2kfj6sg6l_gbcnf29qsm0000gp/T/broccoli-24537nrIycI2Y4tbE/out-239-packager_runner_embroider_webpack/assets/backburner.js:960:1)
    at Backburner._boundAutorunEnd (/var/folders/_b/525y2kfj6sg6l_gbcnf29qsm0000gp/T/broccoli-24537nrIycI2Y4tbE/out-239-packager_runner_embroider_webpack/assets/backburner.js:629:1)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)

If you are using a 3.2.x series of Fastboot and storeConfigInMeta this works fine, but once Embroider comes in to the mix something goes wrong.

This was originally raised in the #fastboot discord channel and this issue is where I think the root cause lives? Could be wrong though since I'm not sure which of Embroider, Fastboot, or Ember Fetch are doing something funky.

A minimal reproduction can be found on this forked branch of ember-realworld-fasboot which disables storeConfigInMeta in the first commit which starts causing issues, and then removes ember-data-storefront to rule it out as the cause.

The workaround for this is to remove the storeConfigInMeta configuration override.

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

1 participant