There’s no reason to put a viewer after a write node. Insert a dot before the write and connect the viewer to it.
Only in very special cases should the output connection of a write node be connected, for example when using the runscript node (see documentation)