How to get untyped npm modules to play nicely with webpack How to get untyped npm modules to play nicely with webpack typescript typescript

How to get untyped npm modules to play nicely with webpack


You need to put your import statement inside the declare module.

declare module '@hyperapp/router' {  import { VNode } from 'hyperapp'  export function Link(props: LinkProps): VNode<LinkProps>  ...}

I had the same error when trying to add the declaration file above (wrote by @m0a whose PR has not been accepted) when the the import statement was on the first line of the file -- which feels most natural.