Unexpected value 'xxx' imported by the module 'AppModule'

When building an app with custom libraries pulling from npm, sometime it shows the following error

Unexpected value 'xxx' imported by the module 'AppModule'

It won't throw this error if the code is put directly with other source files instead of importing from node_modules folder.

The reason is this custom library might forgot to put tsconfig.json into npm package, which providing the information for module and module resolution.