Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
mwbouwkamp opened this issue Nov 17, 2021 · 1 comment

Comments

@mwbouwkamp
Copy link

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} />

  • key is a random number
  • width and height are a string (e.g., "400px")
  • options is a string (e.g., "depict")
  • smiles is the string representation of the structure
  • onChange is a function to update the smiles prop

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
Copy link

Any update on this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants