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

fix: use number type for memory limit #251

Closed
wants to merge 1 commit into from

Conversation

kubukoz
Copy link

@kubukoz kubukoz commented Dec 15, 2021

Which problem is this pull request solving?

The runtime type of the field is number, as per typeof, at least in netlify functions:serve (cli v8.1.4)

Checklist

Please add a x inside each checkbox:

  • I have read the contribution guidelines.
  • The status checks are successful (continuous integration). Those can be seen below. <- waiting on running the workflows

@eduardoboucas
Copy link
Member

Thanks @kubukoz! That property is actually a string in production, but incorrectly typed in the CLI.

lambda-local, the runtime emulator used by the CLI, is setting it as a number here: https://github.com/ashiina/lambda-local/blob/e1fccdac895d4ca45804d48f1d1d79116eac1f06/src/lib/context.ts#L36. We'll try to get a PR to get that changed, otherwise we'll change it on the CLI side.

As a side note, may I ask if you're using this property for anything specific?

@kubukoz
Copy link
Author

kubukoz commented Dec 20, 2021

We're implementing a Scala-friendly API: typelevel/feral#89 <- currently using the numeric type

We get an exception when trying it out locally because of Scala.js's semantics - it seems to be more picky about types when converting from a foreign (.js) type.

@armanbilge
Copy link

We'll try to get a PR to get that changed, otherwise we'll change it on the CLI side.

Done in ashiina/lambda-local#218 and released in https://github.com/ashiina/lambda-local/releases/tag/release%2F2.0.1

@kubukoz kubukoz closed this Oct 5, 2022
@kubukoz kubukoz deleted the context-memory-limit-type branch October 5, 2022 22:27
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