arcanis / ts-pnp

Transparently adds support for Plug'n'Play to TypeScript
67 stars 9 forks source link

Resolving @types package for scoped packages: error TS7016 #7

Open skoging opened 4 years ago

skoging commented 4 years ago

Resolving the @types package for a scoped package fails:

TypeScript error in /.../src/App.tsx(4,30):
Could not find a declaration file for module '@google/maps'. '/.../.yarn/cache/@google-maps-npm-1.1.3-806359610c-fb9081e7e5.zip/node_modules/@google/maps/lib/index.js' implicitly has an 'any' type.
  Try `npm install @types/google__maps` if it exists or add a new declaration (.d.ts) file containing `declare module '@google/maps';`  TS7016

    2 | import logo from './logo.svg';
    3 | import './App.css';
  > 4 | import { createClient } from "@google/maps"
      |                              ^
    5 | 
    6 | function App() {
    7 |   return (

I tried with @reach/router, @babel/core, and @google/maps. All of them fail with the same error, even though @types/reach__router, @types/babel__core, and @types/google__maps is installed.

skoging commented 4 years ago

Seems to have been a simple error where the @ part of the name wasn't removed. The / was correctly replaced with __.

gausie commented 3 years ago

I'm also suffering from this bug