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 everytime "cmdDelimiter: ['{', '}']" defined #216

Closed
weilies opened this issue Jun 13, 2021 · 8 comments
Closed

Error everytime "cmdDelimiter: ['{', '}']" defined #216

weilies opened this issue Jun 13, 2021 · 8 comments

Comments

@weilies
Copy link

weilies commented Jun 13, 2021

I am running into a situation.

  1. If cmdDelimiter not defined, the docx is generated, but {variable} still remain the same.
  2. If cmdDelimiter: ['{', '}'] defined, it error out (as following)

Error: Uncaught (in promise): Error: Error executing command 'name'. TypeError: vm_1.default.Script is not a constructor
Error: Error executing command 'name'. TypeError: vm_1.default.Script is not a constructor

Here is the project, I am running an angular project, angular ver 11++. package.json, tsconfig.json details attached.

Really appreciate for any helps. I am almost there, from tons of runtime errors till now i can see the doc. :D

@KAVA-Leigh
Copy link

I would highly suggest using a different delimiter, may not be the issue in this case- however see #102

@weilies
Copy link
Author

weilies commented Jun 13, 2021

i think it's not about the "{" pattern, i changed my template and code to reference "{{" (double curly brackets), i still get the same error. same project

here are the generated errors

Error: Uncaught (in promise): Error: Error executing command 'name'. TypeError: vm_1.default.Script is not a constructor
Error: Error executing command 'name'. TypeError: vm_1.default.Script is not a constructor
at new CommandExecutionError (https://ng-docx-templates-g1nj3.stackblitz.io/turbo_modules/[email protected]/lib/errors.js:72:28)
at Object.eval (https://ng-docx-templates-g1nj3.stackblitz.io/turbo_modules/[email protected]/lib/jsSandbox.js:104:32)
at step (https://ng-docx-templates-g1nj3.stackblitz.io/turbo_modules/[email protected]/lib/jsSandbox.js:33:23)
at Object.eval [as next] (https://ng-docx-templates-g1nj3.stackblitz.io/turbo_modules/[email protected]/lib/jsSandbox.js:14:53)
at eval (https://ng-docx-templates-g1nj3.stackblitz.io/turbo_modules/[email protected]/lib/jsSandbox.js:8:71)
at new ZoneAwarePromise (https://ng-docx-templates-g1nj3.stackblitz.io/turbo_modules/[email protected]/dist/zone.js:1340:33)
at __awaiter (https://ng-docx-templates-g1nj3.stackblitz.io/turbo_modules/[email protected]/lib/jsSandbox.js:4:12)
at Object.runUserJsAndGetRaw (https://ng-docx-templates-g1nj3.stackblitz.io/turbo_modules/[email protected]/lib/jsSandbox.js:54:12)

@jjhbw
Copy link
Collaborator

jjhbw commented Jun 13, 2021 via email

@weilies
Copy link
Author

weilies commented Jun 13, 2021

Thanks for the helps!!! @jjhbw Love u!!

@jjhbw
Copy link
Collaborator

jjhbw commented Jun 13, 2021

No problem 👍

Feel free to open a new issue if you have a question.

@weilies
Copy link
Author

weilies commented Jun 14, 2021

Yes. Thanks Jurriaan!

@WrightLiam
Copy link

Sorry to bother, but would you happen to have any other recommendations for someone running into this issue?

I seem to be getting this same error using the default delimiters +++, setting custom delimiters doesn't seem to make a change, and adding "nosandBox:true" to the createReport function doesn't make any apparent difference.

Do you have any thoughts off hand or would you need to see the project first?

@jjhbw
Copy link
Collaborator

jjhbw commented Jan 10, 2022

Are you using an Angular toolchain? They tend to do only barebones polyfilling/importing of dependencies. Any dependency import issues you may have (like vm) likely stem from there.

I'm going to need a reproducible example regardless, i'm afraid.
Please make a new issue for that and refer to this one.

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

No branches or pull requests

4 participants