//= require syntax is from Sprockets. Middleman 4 has removed the use of Sprockets from the core. You can use External Pipeline to use JS build tools, such as Webpack, to manage JS assets. Or, if you prefer the old Sprockets way, you just need to enable it in
To do so, add this dependency in
gem 'middleman-sprockets', '~> 4.1.0'
And, you will be able to use Sprockets directives again. Hope this helps.