fix(compile): directive require doesn't throw without link

Closes #3941