I think this happens when you try to render the component on the server side, and browser-side bundling-driven module loading works. I got rid of this error by being more careful with onMount.
at Function._resolveFilename (node:internal/modules/cjs/loader:1244:15) at Function._load (node:internal/modules/cjs/loader:1070:27) at TracingChannel.traceSync (node ...