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

Loading the correct name of the function should fix the 404 error #17

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

aviadsteps
Copy link

No description provided.

@tmilar
Copy link

tmilar commented Dec 24, 2019

What do you mean by "correct name of the function"? the lambda name using the serviceName & stage prefix?

Anyway, I wanted to state that this PR also fixes an issue when running on Windows with no sls "--location" option defined.
Previous to this PR, this was the offending line, in src/index.js#L44
const servicePath = path.join(this.serverless.config.servicePath, this.options.location);

The exception thrown was something like "can't join path with 'undefined' value" (referring to this.options.location) .

The workaround was setting the CLI location variable as an empty string like this: sls offline start --location ''

Please consider merging this PR @marconi1992

@marconi1992
Copy link
Owner

Hi @tmilar, I reproduced the issue with "can't join path with 'undefined' value" . However, we should fix that issue instead of removing the use of the location option.

I noticed the version 5 of serverless-offline already supports this invoking implementation. I'll update the readme file in favor of serverless offline.

https://www.npmjs.com/package/serverless-offline#usage-with-invoke

@tmilar
Copy link

tmilar commented Dec 26, 2019

Ok @marconi1992, just fixing the error for undefined location value sounds fine.
Shall I submit a PR for this?

@marconi1992
Copy link
Owner

Yes @tmilar, I'll appreciate it, thanks in advance.

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

Successfully merging this pull request may close these issues.

3 participants