-
Notifications
You must be signed in to change notification settings - Fork 109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to resolve module error when importing from package with only type definitions #408
Comments
@erikbarke Could you please have a look at the issue? Thanks a lot. I've met the same problem. It can be reproduced in https://github.com/monounity/karma-typescript/tree/master/examples/typescript-latest Just run
|
Thanks @07akioni for figuring it out and @erikbarke for the merge! Is there an easy way to tell when this shows up on NPM? |
I use the NPM package @esri/arcgis-rest-types in a project, and I'm trying to hook up Karma testing using this plugin. It's notable because this package contains no runtime code at all, only
.d.ts
typings. When my code imports one of the types from this package, I get the messageERROR [karma-server]: Error: Unable to resolve module [@esri/arcgis-rest-types] from {source file path}
.I put together a simple reproduction. Clone and
npm install
, thennpm run build
andnpm run start
-- you should see some simple console output. Note that the emitted code does not include any references to the Esri package, since it only contains type information. Now, runnpm run test
, and you should see the aforementioned message.The way I see it, one of three things is happening here:
package.json
or something? -- and for some reason the Typescript language service and Webpack are both happy to use them anyway, while this plugin (correctly) fails, orIf it helps, I can try to find other similar packages that export types only, but aren't in the
@types
namespace and aren't meant to be used in an ambient context.The text was updated successfully, but these errors were encountered: