Got same error.
But i have tried on a clean project and it seem to work maybe is something that is on my project. I’m using tailwind with craco maybe is interfering with the loading of that library. I’m going to investigate if is the case and let you know
I’ve tried on a new create-react-app and I can run & build the app without issues.
The change I did was node detection to change from looking for process to checking for window, i.e:
function nodeRequire() {
//node require(), using dynamic access to fix web ng aot build
try {
return typeof window !== 'undefined' ? null : (typeof require !== 'undefined' ? require : null);
}
catch (e) {
return null;
}
}
var R = nodeRequire();
if (R) R('cross-fetch/polyfill'); //fetch polyfill only required for node.js
@servicestack/client doesn’t have any dependencies when used in a web browser, the cross-fetch/polyfill import should only be loaded when running in node.js to load its node-fetch polyfill implementation of fetch.
The error should be gone now as it shouldn’t be trying to load the dependency anymore, unless something is interfering with it and reassigning window as undefined or something.