You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When trying to add autometrics with a push gateway to a create-react-app project, I get the following error:
ERROR in ./node_modules/@opentelemetry/exporter-prometheus/build/src/PrometheusExporter.js 28:14-28
Module not found: Error: Can't resolve 'url' in '/Users/brettbeutell/fiber/aplos-app/node_modules/@opentelemetry/exporter-prometheus/build/src'
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.
If you want to include a polyfill, you need to:
- add a fallback 'resolve.fallback: { "url": require.resolve("url/") }'
- install 'url'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "url": false }
webpack compiled with 2 errors
No issues found.
The issue appears to be that we need polyfills for node.js core modules.
Maybe it'd be good to have a client-side tailored package of autometrics? Since for browser-based apps we might not need all of the open telemetry deps
The text was updated successfully, but these errors were encountered:
So this is happening because by default, with no other configuration, autometrics currently uses the @opentelemetry/exporter-prometheus package even on the client-side which uses some Node-specific APIs.
I think the shorter-term solution is throwing a better error for the user that explains they need to use the init function whenever attempting to use the autometrics in the client or figuring out a better default setting.
When trying to add autometrics with a push gateway to a create-react-app project, I get the following error:
The issue appears to be that we need polyfills for node.js core modules.
Maybe it'd be good to have a client-side tailored package of autometrics? Since for browser-based apps we might not need all of the open telemetry deps
The text was updated successfully, but these errors were encountered: