question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

The requested module 'sweetalert2/dist/sweetalert2.js' does not provide an export named 'default'

See original GitHub issue

Seems like version 2 does not provide a default export. Installed latest version using npm install, as provided on npm.

Just like you provided on npm, I did this: import Swal from 'sweetalert2/dist/sweetalert2.js'

Title is the error I am getting when importing Swal as module. It works if Import it using script tag though. But that’s not what I want.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
shtalinbergcommented, Jan 26, 2022
"sweetalert2": "^11.3.8",  issue exists
WARNING in ../src/components/SweetAlert.js 5:33-37

export ‘default’ (imported as ‘Swal’) was not found in ‘sweetalert2’ (module has no exports)

1reaction
limontecommented, Jan 26, 2022

🎉 This issue has been resolved in version 11.3.10 🎉

The release is available on:

Your semantic-release bot 📦🚀

Read more comments on GitHub >

github_iconTop Results From Across the Web

The requested module '' does not provide an export named ...
When I try adding my own export in TableCsv.js it says A module cannot have multiple default exports.ts(2528). Here is my code. main.js...
Read more >
The requested module '__' does not provide an export named ...
Note: while this fresh project shows The requested module '@sveltejs/adapter-static' does not provide an export named 'default' - in my original project ...
Read more >
export - JavaScript - MDN Web Docs
This re-exports all named exports from mod as the named exports of the current module, but the default export of mod is not...
Read more >
the requested module does not provide an export named
The reason it didn't work is that Vue provides a named export, whereas you are trying to import it as though it had...
Read more >
Snowpack - The requested module '/web_modules/recoil.js ...
Uncaught SyntaxError: The requested module '/web_modules/recoil.js' does not provide an export named 'RecoilRoot'. I will talk about how to ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found