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

Interoperability with serverless-offline #43

Open
HoneyryderChuck opened this issue Mar 13, 2024 · 0 comments
Open

Interoperability with serverless-offline #43

HoneyryderChuck opened this issue Mar 13, 2024 · 0 comments

Comments

@HoneyryderChuck
Copy link

Trying to set up a project with serverless-rack and serverless-offline.

I've started only with serverless-rack, however I have authorizer functions defined for the http config, which don't get called when running serverless-rack standalone.

Because of that, I looked into using serverless-offline, which invoke authorizers, and integrates with ruby. The problem is that, whenever I run sls offline start, gem dependencies are installed every single time. This seems to be some issue with the "packaging bundle" step of serverless-offline, which somehow isn't well connected with serverless-rack (?).

But that's not all: if I run sls offline start, which packages gem dependencies for me (so, I shouldn't need to perform bundle install beforehand), running the authorizer function will fail regardless, saying "/usr/local/lib/ruby/3.2.0/bundler/definition.rb:524:inmaterialize': Could not find aws-sdk-kms-1.37.0, aws-xray-sdk-0.11.5, datado..., the typical error which is called when dependencies weren't installed. This seems to be yet another misconfiguration between serverless-rack and serverless-offline, which expect dependencies to be installed in different places (serverless-offline does not run the invoke script with bundle exec`, would that be the issue?).

I've fixed this temporarily by running everything in a docker container and running bundle install (what serverless-rack expects) before running sls offline start(which will reinstall the same set of dependencies someplace else).

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

1 participant