-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Closed
Labels
Description
Are you certain it's a bug?
- Yes, it looks like a bug
Is the issue caused by a plugin?
- It is not a plugin issue
Are you using the latest v3 release?
- Yes, I'm using the latest v3 release
Is there an existing issue for this?
- I have searched existing issues, it hasn't been reported yet
Issue description
When I run this config it works:
service: rbk-web
provider:
name: aws
runtime: nodejs14.x
stage: dev
region: us-east-1
functions:
nuxt:
handler: .output/server/index.handler
events:
- httpApi: '*'
with this, it fails
org: franciscoramoso
app: rbk-web
service: rbk-web
provider:
name: aws
runtime: nodejs14.x
stage: dev
region: us-east-1
functions:
nuxt:
handler: .output/server/index.handler
events:
- httpApi: '*'
the s_nuxt.js file generated
var serverlessSDK = require('./serverless_sdk/index.js');
serverlessSDK = new serverlessSDK({
orgId: 'franciscoramoso',
applicationName: 'rbk-web',
serviceName: 'rbk-web',
shouldLogMeta: true,
shouldCompressLogs: true,
disableAwsSpans: false,
disableHttpSpans: false,
stageName: 'dev',
serverlessPlatformStage: 'prod',
devModeEnabled: false,
accessKey: null,
pluginVersion: '6.2.2',
disableFrameworksInstrumentation: false
});
const handlerWrapperArgs = { functionName: 'rbk-web-dev-nuxt', timeout: 6 };
try {
const userHandler = require('./.output/server/index.js');
module.exports.handler = serverlessSDK.handler(userHandler.handler, handlerWrapperArgs);
} catch (error) {
module.exports.handler = serverlessSDK.handler(() => { throw error }, handlerWrapperArgs);
}
It fails because the handler .output/server/index extension is .mjs (.output/server/index.mjs) on the generated file it tries to require it as ./.output/server/index.js
Service configuration (serverless.yml) content
org: franciscoramoso
app: rbk-web
service: rbk-web
provider:
name: aws
runtime: nodejs14.x
stage: dev
region: us-east-1
functions:
nuxt:
handler: .output/server/index.handler
events:
- httpApi: '*'Command name and used flags
sls deploy
Command output
dashboard: https://app.serverless.com/franciscoramoso/apps/rbk-web/rbk-web/dev/us-east-1
endpoint: ANY - https://6rz2udia5m.execute-api.us-east-1.amazonaws.com
functions:
nuxt: rbk-web-dev-nuxt (27 MB)
Serverless Domain Manager:
Domain Name: sls-rbk-web.merchandi.xyz
Target Domain: d-j0jvn8d680.execute-api.us-east-1.amazonaws.com
Hosted Zone Id: Z1UJRXOUMOOFQ8Environment information
serverless --version
Framework Core: 3.22.0
Plugin: 6.2.2
SDK: 4.3.2