bugsnag / bugsnag-js-performance

Monitor the performance of your JavaScript (web and React Native) and see the results in your BugSnag dashboard.
https://docs.bugsnag.com/performance/integration-guides
MIT License
5 stars 3 forks source link

Named export 'isCuid' not found. The requested module '@bugsnag/cuid' is a CommonJS module #441

Closed ondrejsevcik closed 6 months ago

ondrejsevcik commented 7 months ago

Describe the bug

When @bugsnag/browser-performance package is imported in Vitest, it fails with the following error.

Error: SyntaxError: Named export 'isCuid' not found. The requested module '@bugsnag/cuid' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:

import pkg from '@bugsnag/cuid';
const { isCuid } = pkg;

Environment


I could send out PR fixing the import style if you're open to external PR contributors.

toniewypada commented 7 months ago

Hi 👋🏻, our dev team is working on implementing a fix for this. We'll let you know about any updates!

mclack commented 6 months ago

Hi @ondrejsevcik

This has now been fixed in v2.5.0 of bugsnag-js-performance.

Thanks for raising this with us. Please let us know if you continue to have any issues after upgrading to v2.5.0.