update error message and make sure the absolute path without .js can pass check