TensorFlow JS, Problem with Sequential Model

I keep getting this error:
Uncaught (in promise) TypeError: tf.layers.AveragePooling2D is not a function.
I don’t understand why I get this layer since I have imported tensorflow and tf.layers.maxPooling2D does not give any errors. Thanks for your help!