fullstack-typescript | Typescript , React , MobX , Express , GraphQL and TypeORM | GraphQL library
kandi X-RAY | fullstack-typescript Summary
kandi X-RAY | fullstack-typescript Summary
Typescript, React, MobX, Express, GraphQL and TypeORM monorepo.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of fullstack-typescript
fullstack-typescript Key Features
fullstack-typescript Examples and Code Snippets
Community Discussions
Trending Discussions on fullstack-typescript
QUESTION
I'm trying to use a similar setup to this repo to try and create a fullstack typescript app using React and Express.
The repo uses tsc-watch like nodemon to keep an eye on the server files, and then webpack-dev-server to host the react static files at port 8085. Meanwhile the server, running on 3000, renders the react app by proxying all static requests to /statics at 8085.
When I clone the repo everything works. However, in my own repo (where I'm trying to learn how to do a similar configuration, the server keeps throwing up this error:
node_modules/@types/webpack-dev-server/index.d.ts
then:
node_modules/http-proxy-middleware/dist/index"' has no exported member 'Config'.
When I go into node_modules, I can see that @types/webpack-dev-server is expecting there to be Config from http-proxy-middleware. In @types/http-proxy-middleware, there is an interface called Config. However, in the normal http-proxy-middleware node module folder, there is not, and this is what is causing the error.
My question is how do I get @types/webpack-dev-server to use @types/http-proxy-middleware, rather than just node_modules/http-proxy-middleware? Or am I missing something else entirely?
I can post code if needed.
...ANSWER
Answered 2020-Aug-20 at 17:32Here are few facts that might help:
- The statics-router.ts is using
http-proxy-middleware
, version "^1.0.3" webpack-dev-server
is dependent on version "0.19.1"- The
Config
onhttp-proxy-middleware
was removed in version 1. - The type definitions for version 1 are part of
http-proxy-middleware
itself (And not under @types like before) - If you look into
/node_modules/@types/webpack-dev-server/package.json
, you will see that on thedependencies
it has:"@types/http-proxy-middleware": "*"
. Notice that it's dependend on the @types version of the.d.ts
It looks like typescript is searching for the type definitions under node_modules/LIBRARY
first, and then under @types
so it "finds" the .d.ts
for version 1, instead of version 0.19.1
like webpack-dev-server
requires
To solve this just add:
"skipLibCheck": true,
to the shared tsconfig.json
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install fullstack-typescript
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page