Skip to content
New issue

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

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

Already on GitHub? # to your account

InvalidLocale when executed on AWS Lambda #14

Open
danwdart opened this issue Nov 22, 2019 · 0 comments
Open

InvalidLocale when executed on AWS Lambda #14

danwdart opened this issue Nov 22, 2019 · 0 comments

Comments

@danwdart
Copy link

danwdart commented Nov 22, 2019

I constantly get:

InvalidLocale "/root/.stack/snapshots/x86_64-linux-dkda49f7ca9b244180d3cfb1987cbc9743/725dbf2ece650124916bdb7ed49429b9d6fa0789b33a005b976ca08cdf65d49e/8.6.5/share/x86_64-linux-ghc-8.6.5/fakedata-0.2.2/faker/lib/locales/en/star_trek.yml"

My code:

`{-# LANGUAGE OverloadedStrings #-}

module Main where

import AWSLambda
import Data.Function
import Data.Functor
import Faker
import Faker.TvShow.StarTrek
import qualified Data.Text as T
-- import Data.Text (Text)
import Lib
import qualified Data.Aeson as A

gimme :: Fake a -> IO a
gimme = generateWithSettings (setLocale "en" $ setNonDeterministic defaultFakerSettings)

main :: IO ()
main = lambdaMain handler

handler :: A.Value -> IO String
handler evt = do
  str <- character <&> (`T.append` " is awesome") & gimme <&> T.unpack
  putStrLn str
  someFunc
  print evt
  return str

Anyone know what to do about this? I added the setLocale because I thought it'd help but it doesn't...

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

No branches or pull requests

1 participant