DouglasConnect / jsme-react

11 stars 13 forks source link

When using the component in a React project I (seemingly randomly) get an Uncaught TypeError: f is not a function #10

Open mwbouwkamp opened 2 years ago

mwbouwkamp commented 2 years ago

I have created a Mendix widget using the jsme-react component. Sometimes, it seems at random, I get:

Uncaught TypeError: f is not a function
    at index.es.js:137
    at Array.forEach (<anonymous>)
    at window.jsmeOnLoad (index.es.js:136)
    at m (jsme.nocache.js:10)
    at jsme.nocache.js:11
    at l (jsme.nocache.js:7)
    at Function.jsme.onScriptDownloaded (jsme.nocache.js:11)
    at D4DF9EC9DD21B943E35F3D5696D5D2A1.cache.js:1

This is how I am using the component:

<Jsme key={key} width={width} height={height} options={options} smiles={smiles} onChange={onStructureChange} />

The function looks like this:

    const onStructureChange = (_smiles: string): void => {
        if (smiles === _smiles) {
            return;
        }
        props.smiles.setValue(_smiles);
    };

When refreshing the page (typically once or twice), the page is working alright. Also, there does not seem to be a clear pattern on when this is happening.

Is this a known issue?

mwbouwkamp-mendix commented 2 years ago

Any update on this issue?