Skip to content
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

Fix parsing error with lodash #437

Closed
wants to merge 12 commits into from
Closed

Conversation

travoltron
Copy link

When using this library with Babel and lodash, an error arises when trying to send an SMS, or make any changes that require the _.template function to get called.
SyntaxError: Unexpected token = at Function (<anonymous>), specifically source: 'function(obj) {\nobj || (obj = {});\nvar __t, __p = \'\', __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, \'\') }\nwith (obj) {\n__p += \'/Accounts/\';\n= sid ;\n__p += \'.json\';\n\n}\nreturn __p\n}'

To alleviate this, I broke up the template parsing to use concatenated strings, rather than interpolation.

Contributing to Twilio

All third party contributors acknowledge that any contributions they provide will be made under the same open source license that the open source project is provided under.

  • I acknowledge that all my contributions will be made under the project's license.

@childish-sambino
Copy link
Contributor

@travoltron Could you provide sample code that illustrates the issue you're running into?

@childish-sambino childish-sambino added status: waiting for feedback waiting for feedback from the submitter type: question question directed at the library labels Feb 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: waiting for feedback waiting for feedback from the submitter type: question question directed at the library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants