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

Error anytime the delimiter is found within a file. #251

Closed
WrightLiam opened this issue Jan 13, 2022 · 3 comments
Closed

Error anytime the delimiter is found within a file. #251

WrightLiam opened this issue Jan 13, 2022 · 3 comments
Labels

Comments

@WrightLiam
Copy link

WrightLiam commented Jan 13, 2022

I am running into an issue similar to that defined in item #216.

To give a brief summary, it looks like every time the createReport function finds a delimiter it tries to run it as a function. ie:
ERROR Error: Uncaught (in promise): Error: Error executing command 'OFFENSEDATES': OFFENSEDATES is not defined
Error: Error executing command 'OFFENSEDATES': OFFENSEDATES is not define

As a note I made some modifications to the TSCONFIG file and manually installed vm and stream to get it working. And as you deduced in your earlier question I am using Angular

I've created a streamlined version for you to check out on stackblitz through the below link. For ease of access I've added in the word file as an array directly into the app.component.ts file though I have confirmed it works when the program fails to find any delimiters.

There is a commented line in the createReport function where it changes the delimiter from the default +++ to a custom delimiter that is absent from the word file.

https://stackblitz.com/edit/angular-ivy-x5bmbj?file=src%2Fapp%2Fapp.component.ts

Thanks in advance for your time and any help/direction you can provide.

@jjhbw
Copy link
Collaborator

jjhbw commented Jan 13, 2022

Thanks for the detailed example.

createReport function finds a delimiter it tries to run it as a function

No, it executes the 'command' between the delimiters from within a Promise, hence the ugly exception. It interprets everything between the delimiters as JS code and executes it. I don't see any indication that OFFENSEDATES is being interepreted as a function call.

Eyeballing your example, I see OFFENSEDATES is not injected into the VM. I only see offenseDates, which is not the same. Capitalisation matters in variable names, just like when you are writing plain javascript.

Let me know if this solves your issue.

@WrightLiam
Copy link
Author

Well I'll be damned, you're right that was it.

That was the first thing I tried to test when I first started getting the bug and I thought I had the same casing on both in my original tests but I clearly must have made a mistake.

I both apologize for wasting your time with such a silly mistake and also thank you for pointing it out!

@jjhbw
Copy link
Collaborator

jjhbw commented Jan 13, 2022

No problem at all, happy to help 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants