I am upgrading an Angular app that uses fabricjs. The old app was dependent on node14 and I am upgrading to A17, so can use node18.
When I compile, I get a lot of errors like this
✘ [ERROR] Could not resolve "path"
node_modules/jsdom/lib/jsdom/utils.js:3:21:
3 │ const path = require("path");
╵ ~~~~~~
The package "path" wasn't found on the file system but is built into node. Are you trying to bundle for node? You can use "platform: 'node'" to do that, which will remove this error.
This occurs because fabricjs used jsdom, and jsdom uses native node functions.
But my app is for the browser, and shouldn’t be dependent on node (except for the build).
I am confused by both “how did an angular browser app running fabricjs work before” and
what changed – what do I need to do to get it to compile?”
Unless I am misunderstanding, the s=uggestion in the error message doesn’t make sense since the app will run in the browser, not in node.
Help?