React Plugin Build error from manifest 4 to 5

I need some insights on this. My plugin was working well with manifest 4 and until I moved to manifest 5 and now it cannot open. I keep on seeing the following error on uxp debug console. Am unable to connect the dots to what exactly is the issue or what it means. I’ve changed all my manifest to v5 except for the entrypoints which are less complex to require changes. the plugin is based on react

Hello,

add the following to your manifest:

"requiredPermissions": {
    "allowCodeGenerationFromStrings": true
}

wow thankyou. that solved the first red issue. How about the second , I understand what the error means but I don’t understand at the point it gets thrown

I believe this is not allowed for production plugins and would be rejected for Marketplace submission if left. Instead of

<tag onclick="javascript:runSomething();">

you should assign event listeners externally with

doc.selectElByTagName('tag').addEventListener('click', runSomething);

how would this look like on jsx in the case you are using react

Hm, not sure about that. It is also present in the react-starter template that you can create from the UXP developer tool. If it’s indeed the case than this has to be resolved also in the starter templates.

I faced the same issue a few days ago. This solved it for me:

In index.jsx instead of:

show(event) {
    let { node } = event;

    panelUI = document.createElement("div");
    node.appendChild(panelUI);

use this:

show(node) {
    panelUI = document.createElement("div");
    node.appendChild(panelUI);

The parameter now seems to be directly the node and it’s not a prop.
You have it probably in the create entrypoint, but it should be the same.

1 Like

Because it’s needed by Webpack IIRC. You’re not allowed to submit to Marketplace with this permission. Unless something changed

Usually it’s handled by React quite nice

<Component onClick={runSomething}>

So it’s not possible to use Webpack with manifest 5 for plugins we want to publish on the marketplace?
Or is there special option in Webpack that allows us to use it?

Well… Webpack is just for packaging the plugin. After it’s packed, you can remove the permission. It’s actually the same with v4

1 Like

are for source maps and debugging. You don’t need to ship source maps to production builds and webpack also handles that differently when you set production environment.

2 Likes

Well … that’s what I assumed. On a first test I received the error again that’s why I asked. But I changed it in the manifest of the bundled “development” version instead of the production version. After testing again it works fine on the production version. Thanks.

I just checked and I have this in my Webpack config for dev env:

devtool: 'eval-cheap-module-source-map',

And I don’t have allowCodeGenerationFromStrings at all in my manifest (dev or prod) and it works fine without any issues.

thanks I fixed it throught the panelController.

  show = (node: HTMLElement) => {  
    if (!this.#root) this.create()
    this.#attachment = node
    this.#attachment.appendChild(this.#root!)
  }

Am on typescript though

on top of that it’s covered here. Adobe UXP: Things you need to know! #13 Manifest v5 | Davide Barranca — Photoshop, etc.

1 Like

BTW I just installed this plugin https://adobe.com/go/cc_plugins_discover_plugin?pluginId=7fd12df2&workflow=share from the marketplace and it uses "allowCodeGenerationFromStrings": true in the manifest. Was updated today. :man_shrugging:

Maybe some policies changed. Here @kerrishotts says it can be used for dev purposes. And here @Jarda suggests it might not be allowed for Marketplace :man_shrugging: Also this permission is not even in the docs

I’m looking into the current policy and will let you know (I also remember it not being allowed, but I might have missed something) :slightly_smiling_face:

2 Likes