Comments (5)
i had the same issue, make sure if you're using type script and have serverless-plugin-typescript, move middleware plugin before typescript plugin, same for tscpaths
here is my serverless.yml before change
... other configs
plugins:
- serverless-dotenv-plugin
- serverless-plugin-typescript
- serverless-tscpaths
- serverless-middleware
... other configs
after change
... other configs
plugins:
- serverless-dotenv-plugin
- serverless-middleware
- serverless-plugin-typescript
- serverless-tscpaths
... other configs
from serverless-middleware.
Hi,
sorry for the slow response.
The main change introduced in v3.2.0 was to ad the file extension to all files using .js
.
Typescript does not modify imports and this is the recommended way.
Regarding @rezaerami suggestion, the order is important indeed.
If typescript is used before middleware, then everything is compiled by the typescript plugin and then the middlewares are chained together to create the final handler.
If middleware is used before typescript, then a typescript handler is creating importing all the middlewares and then the typescript function transpiles it to javascript.
I always try to put the middleware plugin before any kind of transpilation plugin or any plugin that changes the code
from serverless-middleware.
If you can create a sample project to reproduce the issue, I will fix it :)
from serverless-middleware.
@zoli-kasa, please read #52 as it provides the solution to your problem.
The issue is related to ts-loader & webpack config.
from serverless-middleware.
thanks @juanjoDiaz, it worked!
it'd be nice if you could add this to breaking changes or the changelog.
from serverless-middleware.
Related Issues (20)
- conflict with serverless-plugin-warmup plugin HOT 2
- Serverless stops working after adding middleware (only in production) HOT 10
- Doesn't work with Serverless v3 HOT 3
- v1.0.0 with Serverless V3 throws error on deploy HOT 2
- Cannot do dynamic imports when using a middleware HOT 3
- Allow `nodejs16.x` HOT 1
- serverless-typescript or serverless-esbuild HOT 2
- Path of .middleware folder when searching for modules is broken with default folderName in Serverless 3.0 HOT 4
- Middleware only runs on HTTP API HOT 2
- ERR_MODULE_NOT_FOUND when using Typescript and targeting ES6 or higher HOT 2
- Issue with lambda callbacks HOT 3
- ERR_MODULE_NOT_FOUND using serverless-offline HOT 3
- Middleware function not invoked HOT 1
- Which version of the plugin serverless-middleware supports function level middleware and whats the syntax HOT 1
- serverless-middleware incompatibility with serverless-webpack HOT 4
- Get underlying exception object on pos-catch middleware HOT 2
- I can't setup serverless middleware HOT 1
- other lambda functions are in .middleware. HOT 1
- Support for ECR images
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 serverless-middleware.