You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have seen similar existing issues but I can't seem to make it work. I would like your advice if what im doing is right.
This is what my folder structure looks like:
First on the root of my project folder, I ran "npm install geopoint --save". it added "dependencies": { "geopoint": "^1.0.1" } on package.json. It also added the npm_modules folder and its contents.
In functions/geospatial/get_bounding_coordinates/handler.js, i declared var geopoint = require('geopoint');
In your s-function.json you have to specify your handler as functions/geospatial/get_bounding_coordinates/handler.handler. This will set the function root to the directory containing the node_modules. From my experience it is better to have the function root in a subfolder of the project, as otherwise all serverless plugins will be also packaged.
Hi! Thank you very much for the answer! It worked! What do you mean by setting the function root in the subfolder? is it forexample putting the node_modules folder and package.json file under functions folder?
Hi @taptip would be great if we could move this discussion into our Gitter chat so we can have support questions there. We will make our documentation a lot better to cover this in the future.
I will close the issue for now to mark it as resolved.
Hi,
I have seen similar existing issues but I can't seem to make it work. I would like your advice if what im doing is right.
This is what my folder structure looks like:
First on the root of my project folder, I ran "npm install geopoint --save". it added
"dependencies": { "geopoint": "^1.0.1" }
on package.json. It also added the npm_modules folder and its contents.In functions/geospatial/get_bounding_coordinates/handler.js, i declared
var geopoint = require('geopoint');
The error is that lambda returns:
Is there something wrong with my implementation?
The text was updated successfully, but these errors were encountered: