diff --git a/src/AliasUniquifier.php b/src/AliasUniquifier.php
index c430f0a..777600b 100644
--- a/src/AliasUniquifier.php
+++ b/src/AliasUniquifier.php
@@ -57,15 +57,6 @@ class AliasUniquifier implements AliasUniquifierInterface {
   protected $aliasManager;
 
   /**
-   * Stores the last matching route name.
-   *
-   * Used to prevent a loop if the same route matches a given pattern.
-   *
-   * @var
-   */
-  protected $lastRouteName;
-
-  /**
    * Creates a new AliasUniquifier.
    *
    * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
@@ -169,16 +160,9 @@ class AliasUniquifier implements AliasUniquifierInterface {
 
     try {
       $route = $this->urlMatcher->match($path);
-
-      if ($route['_route'] == $this->lastRouteName) {
-        throw new \InvalidArgumentException('The given alias pattern (' . $path . ') always matches the route ' . $this->lastRouteName);
-      }
-
-      $this->lastRouteName = $route['_route'];
-      return TRUE;
+      return isset($route['_route_object']) && ($route['_route_object']->getPath() == $path);
     }
     catch (ResourceNotFoundException $e) {
-      $this->lastRouteName = NULL;
       return FALSE;
     }
   }
diff --git a/src/Tests/PathautoNodeWebTest.php b/src/Tests/PathautoNodeWebTest.php
index 83a3fb5..851751f 100644
--- a/src/Tests/PathautoNodeWebTest.php
+++ b/src/Tests/PathautoNodeWebTest.php
@@ -253,4 +253,26 @@ class PathautoNodeWebTest extends WebTestBase {
     $this->assertNull(\Drupal::keyValue('pathauto_state.node')->get($node->id()), 'Pathauto state was deleted');
   }
 
+  /**
+   * Tests that patterns can coexist with routes with arguments.
+   */
+  public function testPatternMatchingDynamicRoute() {
+    $this->drupalLogin($this->rootUser);
+
+    // Create a pattern for nodes that matches with a view path
+    // defined at pathauto_node test module.
+    $this->createPattern('node', '/node/[node:title]', -1);
+
+    // Create an article.
+    $edit = array(
+      'title[0][value]' => '1',
+    );
+    $this->drupalPostForm('node/add/article', $edit, t('Save and publish'));
+
+    // Check that the alias exists and works.
+    $this->assertAliasExists(array('alias' => '/node/1'));
+    $this->drupalGet('node/1');
+    $this->assertResponse(200);
+  }
+
 }
