Custom React widget - Unknow widget error when running application

0
Hi, I have been working on building custom react widgets in Mendix 8 and from yesterday afternoon they won’t load in the project where I am developing them, see the error below. However when I copy the mpk file from my development project to another project it works fine, see the second screenshot. I cleaned the deployment directory and also reopened the Mendix project but I still get the same issue. In Mendix, the widgets are visible in the toolbox, they seem to refresh when I modify them (for example, when I add inputs in the code I can see them in Mendix). Any idea what’s up there? I am able to test but I have to copy the mpk file to my other project to do so… it is becoming time consuming 😉   Thanks, Seb      
asked
5 answers
0

And you do the dance:

  • “npm run dev” from command prompt
  • F4 in the modeler to synch the project directory
  • Update All Widgets?
answered
0

Hi Tim, 

yes I do.

There was a time where after F4 my custom widget was not showing in the Toolbox but now it is.

And when I modify the list of inputs of my widget through the xml, I can see the change in the Mendix project. Still when it is running, it says the widget cannot be found.

answered
0

Maybe check your widgets folder for extraneous widgets. If you changed the name of a widget or the package name, you might have an extra copy in there.

Other than that, you could try manually cleaning your deployment folder by deleting the web folder from it.

Those are the only the two places where widgets live at any point in your project directory.

answered
0

I didn’t find extra items in the folder, and deleting the web folder didn’t work.

I removed the widgets from the page and noticed I was still getting the error when running it.

Not sure what the cause really was but I recreated a new page and now it works fine.

Thank you for your help.

answered
0

Please open your react project, go to package.json and check for the value you have entered in ‘projectPath’ attibute.

Putting in the right path that leads to your project root directory will lead to widget mpk file being placed in the right place everytime and save your manual efforts.

answered