My code is working in preview, but no working when published.

Thank for the tips! But now is showing another error: