Lambda does not work when sorting with Java stream and using thenComparing

When I'm trying to sort a list with stream and using thenComparing method, something like this (using method reference) works fine:

Comparator.comparing(String::length).thenComparing(...

but when I'm replacing method reference with lambda:

Comparator.comparing(s -> s.length()).thenComparing(...

it does not (it's not seeing length() method in s object).

Without thenComparing it's working in both cases (either using method reference or lambda).

What is the reason?