Repository navigation
Closed
Labels
Description
This is a Bug Report
Description
- What went wrong?
Execution of serverless package yields Cannot read property 'substr' of undefined - there is no change in my serverless.yml from the prior version.
- What did you expect should have happened?
serverless package does not yield the correct result, it should execute successfully.
- What was the config you used?
service: myFunction
tenant: myAccount
app: myApp
provider:
name: aws
runtime: nodejs8.10
timeout: 25
memorySize: 128
region: us-east-1
stage: dev
iamRoleStatements:
- Effect: "Allow" # xray permissions (required)
Action:
- "xray:PutTraceSegments"
- "xray:PutTelemetryRecords"
Resource:
- "*"
environment:
ENV: ${opt:stage, self:provider.stage}
REGION: ${opt:stage, self:provider.region}
TRACING_ENABLED: true
# you can add packaging information here
package:
excludeDevDependencies: true
plugins:
- serverless-pseudo-parameters
- serverless-plugin-tracing
- serverless-iam-roles-per-function
- serverless-plugin-optimize
- serverless-offline
functions:
myFunction:
name: myProject-${self:provider.stage}-${self:service}
handler: src/handler.handler
tracing: true
layers:
- [REDACTED]
package:
include:
- src/**
- node_modules/**
- package.json
iamRoleStatementsInherit: true- What stacktrace or error message from your provider did you see?
Serverless: Optimize: starting engines
Serverless: Optimize: myApp-dev-myFunction
Serverless: Packaging service...
Serverless: Excluding development dependencies...
Serverless: Tracing ENABLED for function "myApp-dev-myFunction"
Type Error ---------------------------------------------
Cannot read property 'substr' of undefined
For debugging logs, run again after setting the "SLS_DEBUG=*" environment variable.
Get Support --------------------------------------------
Docs: docs.serverless.com
Bugs: github.com/serverless/serverless/issues
Issues: forum.serverless.com
Your Environment Information -----------------------------
OS: darwin
Node Version: 8.15.0
Serverless Version: 1.39.0
Similar or dependent issues:
- None
Additional Data
- Serverless Framework Version you're using: 1.39.0, functions fine with identical config running against 1.38.0
- Operating System: MacOS
- Stack Trace: As above
- Provider Error messages: As above
Reacted by Chris Moyer, Artur Rivilis, Jonathon Belotti, Stephane and Sergio Flores
Activity
kopertop commentedon Mar 15, 2019
I just ran into the same issue and was starting a bug report myself. THe issue appears to be related to
serverless/lib/plugins/aws/package/lib/saveServiceState.jsThe issue is resolved if I replace this line to double-check that
packageRef.artifactis also defined on line 32:Full stack trace with DEBUG:
taniskint commentedon Mar 15, 2019
I am having the same issue as well. My stack traces are identical to kopertop's. I can also confirm that it works on Serverless 1.36.3, if that helps at all.
pmuens commentedon Mar 18, 2019
Just reverted #4188 which seems to be the root cause. Patch release should be out in ~30 minutes...