Last active
July 3, 2019 23:43
-
-
Save mranawake/add1879ea076d19bc3d123c376a7ef15 to your computer and use it in GitHub Desktop.
If you are using AWS Lambda Layers and using WebStorm as the IDE, probably your Layer's aren't being evaluated by the IDE due to incorrect paths. See below for a hack solution.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Let's assume the "util.js" layer file is saved here: /lib/helpers/nodejs/util.js | |
// You will refer to the layer like below (according to AWS docs). | |
const Util = require('/opt/nodejs/src/util'); | |
// Above will work, however WebStorm will give you annoying the "unresolved" warning | |
// and will not show the code completion. As a solution, create a symlink in your project | |
// to simulate the layer mount path. See below: | |
// ln -s lib/helpers opt | |
// MAJOR DOWNSIDE: This will only work for a single layer. | |
// If you have a solution for multiple layers (hack solution like above or a proper IDE level), | |
// please comment below. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment