Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to deploy single functions #97

Open
davidfells opened this issue Apr 18, 2020 · 2 comments
Open

Unable to deploy single functions #97

davidfells opened this issue Apr 18, 2020 · 2 comments

Comments

@davidfells
Copy link

See example below. Full deployments run fine, but individual functions fail - aalways with the same error.

`
➜ pricr git:(serverless) ✗ sls deploy function --function pricingInsert
Serverless: Optimize: starting engines
Serverless: Optimize: pricr-development-pricingInsert

Syntax Error -------------------------------------------

SyntaxError: Assigning to rvalue (1:33522) while parsing /Users/davidfells/Projects/pricr/serverless_sdk/index.js while parsing file: /Users/davidfells/Projects/pricr/serverless_sdk/index.js
`

@vicary
Copy link

vicary commented May 24, 2020

This package lacks essential settings while defaulting to a somewhat aggressive strategy.

I ended up replacing serverless-plugin-typescript and this one with serverless-webpack in my 12 projects. You need 15 min of hard crunching on the docs for your first webpack.config.js to make sense, but it will surely pays off.

@vicary
Copy link

vicary commented Jun 11, 2020

I ended up finding a workaround for this when porting all feature branches to serverless-webpack from this.

The problem is caused by babelify and @babel/core, they don't like the pre-bundled, already minified .build/serverless_sdk/index.js.

Current workaround is to add the following lines in your serverless.yml,

custom:
  optimize:
    ignore:
      - .build/serverless_sdk

IMO this package, being a serverless plugin, is responsible to take care of it by itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants