Make sure that the database compatibility level is 130
you can use the following query to change it:
ALTER DATABASE [DatabaseName] SET COMPATIBILITY_LEVEL = 130
As mentioned in the comments, you can check the current compatibility level of a database using the following command:
SELECT compatibility_level FROM sys.databases WHERE name="Your-Database-Name";