JS1234: Only type and package definitions are allowed inside a library
The code is being compiled to create a library, but it contains declarations that are not allowed. Code that is used to create libraries can contain only classes, interfaces, and packages.
To correct this error
Make sure that the code contains only classes, interfaces, and packages.