Hi all :wave: Question about the <Share Code Betwe...
# help
a
Hi all 👋 Question about the Share Code Between Services chapter. I'm following this:
In our example, we want to share some common code. We’ll be placing these in a 
libs/
 directory. Our services need to make calls to various AWS services using the AWS SDK. And we have the common SDK configuration code in the 
libs/aws-sdk.js
 file.
So in my monorepo, I have:
Copy code
- service1/
- service2/
- libs/
- - - automation-helper
And in
service1
:
Copy code
import { convertJsonStrToObj, generateResponse, validatePayload } from '../../libs/automation-helper';
But I'm getting this serverless error when running
serverless invoke local
😭 Any ideas? Thanks!
Maybe it's because I'm using
export const ...
in
automation-helper
instead of
export default
?
f
Hey @Anthony Xiques, I would put
automation-helper
in the same folder as ur lambda file, and import it like
import .. from "./automation-helper
once that works, move it to libs
might be able to track down the issue this way
a
very smart 🙂 let me try that!