-
Notifications
You must be signed in to change notification settings - Fork 59
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
Can not deploy local dependencies #325
Comments
Thank you so much for opening your first issue in this project! We'll try to get back to it as quickly as possible. While you are waiting...here's a random picture of a corgi (powered by dog.ceo) |
Hey @wandergeek, delighted to hear you're enjoying working with the toolkit! The issue that you have here is based on how the toolkit chooses files to upload and interacts with the Runtime API. You've added a dependency to a local directory within the project, which certainly works in regular Node.js situations, such as running the project locally. The toolkit does not automatically upload files from the In this case, it's best to try to work with the way that the Twilio Functions platform wants you to work. In your Functions that live in the Create module.exports = {
blahFunc: async (bla) => {
// blahFunc implementation
}
}; Then in your Function you need to use the function const a = require(Runtime.getAssets()["/a.js"].path);
a.blahFunc(bla) You can see an example of how I've done this in this example Jira plugin using Twilio Functions (see the The Toolkit currently supports the way that the Twilio platform expects things to work, but it also works as if it is a regular Node.js project on your machine, which is why your project worked locally. We have some ideas for detecting things that will work locally but won't when deployed but we haven't managed to implement them just yet. Let me know if this explanation helps and if you are able to deploy your project successfully. |
Oh man, that's perfect-- that worked like a charm. Thanks so much for taking the time explain this with examples, and once again thanks for the great work! |
I also just noticed you're also from Melbourne! Hello from Brunswick! :D |
Glad that worked out for you! And hello from Fitzroy 👋 not far away at all! |
Hey there!
I've been having a lot of fun with this toolkit so first off, shout out to such a great project! Second off, nodejs is not my strong suit, so if this is a total noob question, please feel free to tell me to RTFM and point me to any relevant documentation.
I've been trying to import a local module of helper functions into my functions and I seem to be having a hard time. This is what I've tried so far:
Created a new module
results in package.json in root
Adding code to ../lib/a.js
Use the module in my twilio function
This works totally fine when testing locally via
npm start
, but as soon as I deploy, I get this error message:Where error 20001 points to an error called
Unknown parameters
.Can one of you twilios out there lend a pal a hand?
Thanks heaps!
The text was updated successfully, but these errors were encountered: