unable to compile TS app - missing @types/type-is apollo-server-express
See original GitHub issueAfter installing apollo-server-express
and running tsc
to compile the app i get the following error:
Error: Command failed with exit code 2: ./node_modules/.bin/tsc -p tsconfig.build.json
node_modules/apollo-server-express/src/ApolloServer.ts(20,20): error TS7016: Could not find a declaration file for module 'type-is'. '/Users/fabriziofenoglio/Documents/gg/node_modules/type-is/index.js' implicitly has an 'any' type.
Try `npm install @types/type-is` if it exists or add a new declaration (.d.ts) file containing `declare module 'type-is';`
at makeError
I can manually solve this by installing @types/type-is
but, this surely should be included in the devDependencies
of apollo-server-express
apollo-server-express version: ^2.9.16
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Error: TSError: Unable to compile TypeScript - Stack Overflow
I had met same issue. First I remove ts-node and typescript from package.json . then, npm install ts-node --save-dev npm install typescript ......
Read more >Build a GraphQL app in Node.js with TypeScript and graphql ...
In this article, we will build a full-stack app using GraphQL and TypeScript. Here, we will use the apollo-server-express package to build a ......
Read more >Apollo Server Express 3 With TypeScript - rockyourcode
Compiled files (from TypeScript to JavaScript) will land in the dist folder. You can find more details in the links at the end...
Read more >How To Run TypeScript Scripts with ts-node - DigitalOcean
With TypeScript being a superset of JavaScript, using it means compiling your TypeScript files down to pure JavaScript before the V8 engine can ......
Read more >Nuxt 3 build logs "unable to compile TypeScript" - Support
App on Netlify https://courageous-fox-6869a5.netlify.app Code on Github https://github.com/p3t3r67x0/nuxt-rc-netlify Issue on Build Nuxt 3 build fails as it ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi, this is a reproduction of the above error: https://github.com/bwlt/apollo-server/tree/repro-3691 I’m having the same issue. The scenario is:
The problem occurs when I import { ExpressContext } from “apollo-server-express/src/ApolloServer”.
Replacing
with
will fix the issue
Importing from
package/src/somefile
orpackage/dist/somefile
is not officially supported. We do our best to choose what gets exported from the top level of a package and everything inside is an implementation detail. (Some other Apollo projects like Apollo Client explicitly set up deeper exports, but Apollo Server doesn’t.)The symbol in question
ExpressContext
has been exported fromapollo-server-express
since v2.19.2, so you can now just doimport { ExpressContext } from 'apollo-server-express'
and it should just work. (I looked at the reproduction, upgraded it to v2.19.2 and changed the import line, and it worked. It also works with 3.3.0.)@shellscape , are you running into this with the same symbol or a different one?