Comments (4)
Hey,
it means, that TS node configuration is not including 'express-session-types',
you need make sure 'express-session-types' are included in your compilation. My guess is tsc resolves 'express-session' only to 'node_modules/@types/express-session' and no declaration is read from 'express-session-types'
from typescript-node-starter.
in your current project, make sure the code that augments 'express-session' (adding 'returnTo') is included, e.g. you can import this code into entry module. The case is to force 'tsc' to properly resolve 'express-session' first (@types/express-session) and next 'express-session' augmentation code. This setup has to work for both regular and 'ts-node' setup. 'ts-node'' has special syntax to resolve deps properly (e.g. to read dedicated tsconfig). I think this is the problem. The example here ('express-session-types') is use-case specific example on how to incorporate 'returnTo' property.
from typescript-node-starter.
Thank you very much for this resolution, indeed the solution was to force the import within the app.ts file in the following way. ❤️
import * as sessionTypes from './types/express-session-types';
from typescript-node-starter.
Indeed, but when doing it either with typeRoot or including the types, it takes by default the ones from the types folder inside the src and not the node_modules, sometimes the express-session call inside the app.ts file has no effect because it is not callable.
When trying to do the following
app.use(session({
resave: true,
saveUninitialized: true,
secret: SESSION_SECRET,
store: new MongoStore({
mongoUrl,
mongoOptions: {
autoReconnect: true
}
})
}));
The following error occurs, so even if the call to the types is made, the execution in development mode still does not work.
This expression is not callable.
from typescript-node-starter.
Related Issues (20)
- README link to TypeScript Website's documentation is broken HOT 1
- client ts files and server ts files should compile to diffrent target HOT 3
- None of the tests pass. HOT 3
- Upgrade to TS 4.0 HOT 6
- Live demo is not working HOT 1
- :( Application Error If you are the application administrator, you can access the diagnostic resources. HOT 3
- Add a sample azure-pipelines.yml HOT 2
- Cannot read property 'picture' of undefined HOT 2
- Upgrade the connect-mongo package to v4 HOT 1
- To add more topics to this repository
- Checked out from master and audit still reported high severity vulnerability found.
- [Node] MongoError: E11000 duplicate key error collection HOT 1
- MongoNetworkError: failed to connect to server [localhost:27017] on first connect [Error: connect ECONNREFUSED 127.0.0.1:27017 HOT 1
- Cannot GET /favicon.ico HOT 2
- Error(s) on update dependencies HOT 2
- The README.md live demo link is broken HOT 3
- User.ts - why Pre Middleware instead of setter for password? HOT 1
- Cannot find tsconfig.test.json HOT 1
- build failed HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from typescript-node-starter.