Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncaught SyntaxError: The requested module does not provide an export named 'default' #544

Open
natemate90 opened this issue Dec 3, 2024 · 6 comments
Labels
backlog We hope to fix this feature/bug in the future

Comments

@natemate90
Copy link

natemate90 commented Dec 3, 2024

CUID import failing

persistence.js fails to import CUID

Steps to reproduce

  1. npx nuxi@latest init cuid-bugsnag-problem
  2. y
  3. enter (npm)
  4. cd cuid-bugsnag-problem
  5. npm i nuxt-bugsnag (will install version 8.1.0)
  6. npx nuxi@latest module add bugsnag
  7. enable bugsnag in nuxt.config.ts:
    performance: true,
    config: {
      apiKey: 'API_KEY_HERE',
      enabledReleaseStages: ['development'],
      releaseStage: 'development'
    }
  }

error:
Uncaught SyntaxError: The requested module '/_nuxt/node_modules/@bugsnag/cuid/index.js?v=4cb633df'

Environment

  • BugSnag Performance library version: 2.10.0

Example Repo

https://github.com/natemate90/cuid-bugsnag-problem

@natemate90
Copy link
Author

Screenshot 2024-12-03 at 16 26 32

@clr182
Copy link

clr182 commented Dec 3, 2024

Hi @natemate90

Thank you for reaching out.

The nuxt-Bugsnag dependency is an unofficial dependency, as such, if you are experiencing issues you may prefer to reach out to the developer here as they may be able to provide more insight.

While nuxt is not something we officially support at this moment in time, we do have official support on our backlog of items. Unfortunately I do not have a clear ETA on the release of this functionality, however we will be sure to update this thread with more information when priorities allow.

@clr182 clr182 added the backlog We hope to fix this feature/bug in the future label Dec 3, 2024
@natemate90
Copy link
Author

natemate90 commented Dec 3, 2024

Hi @clr182 thanks for responding. As you can see in the error, it seems that under the hood, this issue is a reference of cuid from @busgnag/core-performance. So it seems that it's irrelevant whether this is used in nuxt or not. Can you investigate the issue?

@clr182
Copy link

clr182 commented Dec 4, 2024

Hi @natemate90

From the sounds of it, we are going to need to make an update to add a new export to our cuid lib for ES module compatibility.

It the meantime as we work on an update, you can implement a monkey patch by adding the following to the @bugsnag/cuid index.js

module.exports.default = module.exports

@natemate90
Copy link
Author

Thanks @clr182 for picking this up. We'll gladly wait for this fix to enable the performance tool

@JulianMar
Copy link

@clr182 Can you provide a timeline for this fix?
Can I change something on the nuxt-bugsnag level to fix this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backlog We hope to fix this feature/bug in the future
Projects
None yet
Development

No branches or pull requests

3 participants