Copy link to clipboard
Copied
Hi again folks, following my previous post I've managed to make some headway with my CEP extension, however I've hit a bit of a snag with using third party node modules.
Despite following the instructions on here it seems that including the third party module is not currently working, the most likely reason I can see for this is that when I add this line to the HEAD tag of my html file:
<script type="text/javascript">window.nodeRequire=window.require && window.require=undefined</s
cript>
I am getting the following error in the console:
since I am requiring the module in my JSX file in the usual manner:
var module = require('some-module');
I would imagine that the broken line above is the cause.
I've been trying to debug the issue but as this problem seems to be specifically an Adobe extension issue I have so far been unsuccessful.
Can anyone save me some time (and hair) and tell me what the problem is?
Thanks
As i described before jsx interacts with the InDesign and Extendscript DOM, you can't use Node Module in it. If you look at the documentation also, it specifically mentions.
Whatever be the use case, as i had mentioned in the previous post you need to leverage the communication methods between jsx and js to get your work done. So if you want to use node module, use it in js and pass the result to jsx if that is to be further processed in the dom
...Copy link to clipboard
Copied
As i described before jsx interacts with the InDesign and Extendscript DOM, you can't use Node Module in it. If you look at the documentation also, it specifically mentions.
Whatever be the use case, as i had mentioned in the previous post you need to leverage the communication methods between jsx and js to get your work done. So if you want to use node module, use it in js and pass the result to jsx if that is to be further processed in the domain of InDesign and Extendscript DOM
-Manan
Copy link to clipboard
Copied
Thanks for your response Manan