Nexrender: TypeError: `.matchAll` does not allow Script to execute when passed to Worker

Created on 16 Jun 2020  路  18Comments  路  Source: inlife/nexrender

Hi,
I am passing JSX script while adding the job to the server.

let projectJson = {
    "template": {
        src: "file:///template.aepx",
        "composition": "BLANK_COMP"
    },
    "assets": [{
        src: ""file:///sampleParamInjection.jsx"",
        "type": "script"
    }]
}
const result = await client.addJob(projectJson)

But it gives the following error while passing the script.

TypeError: script.matchAll is not a function
    at EnhancedScript.findMissingMatchesInJSX

Can you help me out
Also I want to add settings to addJob functions, So is there any possibility to add settings to Job ?

Thanks :)

bug

Most helpful comment

yes, 1.17.3 fixes the issue in my case! 馃帀

All 18 comments

Try removing a second pair of " in the script asset src parameter, to check if that helps.

Also I want to add settings to addJob functions, So is there any possibility to add settings to Job ?

What kind of settings are you referring to?
Keep in mind that you are using API to add job to the server, and then possibly a remote system will fetch it and render it. Settings are usually system-defined set of parameters, not something that can be transferred over the network and applied in real-time.

Hi @inlife ,
After removing second pair of " in the script, Still the error seems to be there.
And setting like skipRender:true, I want to pass it within addJob function so is there any possibility.

Thanks :)

In that case, i'm not sure what might be going on. The most logical conclusion I can deduct is that script is empty, is that can be the case?

No, the script is not empty. Still the error is there.

Thanks :)

Could you please check out, maybe your issue is somehow related to this one: https://github.com/inlife/nexrender/issues/320?

Yes this is the same issue I am facing.

does the solution (or summary) from that issue apply to you, or maybe does it fix things for you?

No it doesn't but when I comment out this.findMissingMatchesInJSX() function within within @nexrender -> core -> script.js file its solves the issue

@dukuo could you help me understand why is that happening, and how can we solve that?

I will check it out as soon as I can, hopefully it's an easy fix.

@inlife Hey there! I'm having this same issue.

Getting this error after passing a JSX script to a nexrender job. Using npm and @nexrender/core.

TypeError: script.matchAll is not a function
    at EnhancedScript.findMissingMatchesInJSX

Here's my job:

const job = {
        template: {
            src: `file://${template}`,
            composition: `${renderComp}`,
        },
        assets: [
            {
                src: `file://${renderDirectory}/pivvot-engine_render_01.jsx`,
                type: 'script',
                keyword: '_pivvot',
                parameters: [
                    {
                        key: 'renderComp',
                        value: renderComp,
                    },
                    {
                        key: 'dataPath',
                        value: renderDirectory,
                    },
                ],
            },
        ],
    };

It is correctly duplicating the folder and duplicating the AE script - so the actual file is being passed correctly. The duplicated script is not empty.

Any idea on how to solve this?

Update:

I found out .matchAll() isn't supported by older versions of Node. After updating from v10 to v12, it seems to fix the error!

You are absolutely right @itstheonlychris ! I apologize for not being able to get a peak on this issue, things have been a little messy with this pandemic stuff going on.

I remembered now that I asked @inlife about Node compatibility because of matchAll. See compatibility.

What do you think @inlife ? Should we update the docs for v12 requirement ?

Actually, is there an alternative that we can use that would support the v10?
Maybe something like this: https://github.com/IonicaBizau/match-all

I would have to look into it; I didn't want to use any external deps to keep it as lean as possible.

If it's a drop-in replacement then it sounds good to me. I'll test it out and see what happens (if anyone wants to step in that'll work as well)

Published it as 1.17.3, @darshakgosar @itstheonlychris you can try it out, to see if that fixes it!

yes, 1.17.3 fixes the issue in my case! 馃帀

Was this page helpful?
0 / 5 - 0 ratings

Related issues

senthudms picture senthudms  路  3Comments

byumark picture byumark  路  3Comments

Morreski picture Morreski  路  5Comments

JamesBotterill picture JamesBotterill  路  4Comments

bluematter picture bluematter  路  5Comments