 core/modules/rest/src/Routing/ResourceRoutes.php | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/core/modules/rest/src/Routing/ResourceRoutes.php b/core/modules/rest/src/Routing/ResourceRoutes.php
index 468cc5c..1589bf4 100644
--- a/core/modules/rest/src/Routing/ResourceRoutes.php
+++ b/core/modules/rest/src/Routing/ResourceRoutes.php
@@ -64,7 +64,14 @@ public function __construct(ResourcePluginManager $manager, ConfigFactoryInterfa
    */
   protected function alterRoutes(RouteCollection $collection) {
     $routes = array();
-    $enabled_resources = $this->config->get('rest.settings')->get('resources') ?: array();
+
+    // Silently ignore resources that are in the settings but are not defined on
+    // the plugin manager currently. That avoids exceptions when REST module is
+    // enabled before another module that provides the resource plugin specified
+    // in the settings.
+    // @todo Remove in https://www.drupal.org/node/2308745
+    $resources = $this->config->get('rest.settings')->get('resources') ?: array();
+    $enabled_resources = array_intersect_key($resources, $this->manager->getDefinitions());
 
     // Iterate over all enabled resource plugins.
     foreach ($enabled_resources as $id => $enabled_methods) {
