Did you already work with other library imports before? Are you building the widget in typescript and not seeing any syntax error in the code whilst running from Visual Studio Code?
If the answer on all these tree questions is yes, then this is strange. I have built many custom and Pluggable widgets and loaded many libraries but never saw this.
The factoryThrew error does ring a bell; in Dojo based widgets this typically occurred when two files from most of the times different widgets conflicted / used the same variable name.
What worked before for me to locate the origin of this type of error was setting the setting ‘bundle widgets when running locally’ to ‘true’ to bundle all widget files to one big JavaScript file (as is done with a normal non local deployment). I believe this is done by webpack. That would then spot the error, which can then be found in a log file which webpack generates and is put in the deployment/ data folder somewhere
Hope this helps!
For some reason importing intro.js does work. It seems that it’s the intro.js-react library that leads to the issue. I’m now trying to use that instead and replicating some of the intro.js-react functionality myself. But now I’m running into an issue where I’d like to use a function from react-dom/server (rendertoStaticMarkup), which also seems to lead to import issues.
I’m using this import statement:
import { renderToStaticMarkup } from 'react-dom/server';
It says:
404 - file not found for file: mxclientsystem/react-dom/server.js
Is it maybe that this isn’t exposed and therefore is leading to issues for both my widget and the use of any library that also uses react-dom/server? Or am I doing something wrong with the import?
In the end I ended up building my own widget without the use of the intro.js library or the react-dom/server library. Took some more time, but got what I needed. I did test adding the react-dom/server widget to a new empty widget, which also did not work. So I’ve created a support ticket for that.