Skip to main content
Hey Evgenii
Inspiring
Jan 12, 2024 10:04 PM UTC
Answered

External module doesn't work

Hello guys I am trying to run 'clipboardy' node module in CEP panel, but it doesn't work
I have a simple setup html, index.js with CEP 10

html tags:

<script type="text/javascript" src="libs/CSInterface.js"></script>
<script type="text/javascript" src="index.js"></script>

manifest params:
<Parameter>--allow-file-access</Parameter>
<Parameter>--allow-file-access-from-files</Parameter>
<Parameter>--enable-nodejs</Parameter>
<Parameter>--mixed-context</Parameter>
<Parameter>--disable-web-security</Parameter>

I was trying to use both require and import but none seems to work
 

 

 

 

 

const clipboardy = require('clipboardy');
//or import clipboardy from "clipboard";
alert(clipboardy.toString());

 

 

 



while const fontlist = require("font-list"); works fine for me 


what can be the problem?

 

This topic is closed to new replies. Start a new post to keep the conversation going.
Manan JoshiCorrect answer
Community Expert
Mar 18, 2024 4:26 AM UTC

Do you see any errors in the developr console or logs? CEP does have issues loading some nodejs native modules for example I faced issue with a sqlite3 in the past and I resolved that using wasm. See the following discussion it might apply to your use case

https://community.adobe.com/t5/indesign-discussions/c-node-addons-supported-in-cep/m-p/11048562

-Manan

-Manan

1 reply

Manan JoshiCommunity ExpertCorrect answer
Community Expert
Mar 18, 2024 4:26 AM UTC

Do you see any errors in the developr console or logs? CEP does have issues loading some nodejs native modules for example I faced issue with a sqlite3 in the past and I resolved that using wasm. See the following discussion it might apply to your use case

https://community.adobe.com/t5/indesign-discussions/c-node-addons-supported-in-cep/m-p/11048562

-Manan

Translate
-Manan