-
-
Notifications
You must be signed in to change notification settings - Fork 92
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
Themes in NextJS doesn't work #84
Comments
I believe you missed this detail from the docs: // index.js
- import Swal from 'sweetalert2'
+ import Swal from 'sweetalert2/src/sweetalert2.js' Let me know if this helped |
import Swal from "sweetalert2/src/sweetalert2.js" is throwing an error:
Same if I remove the ".js" extension |
That's completely unrelated issue, https://stackoverflow.com/questions/58211880/uncaught-syntaxerror-cannot-use-import-statement-outside-a-module-when-import |
All right I had to use this instead: import Swal from "sweetalert2/dist/sweetalert2.js"; The problem is that this isn't specified in the README of sweetalert2-react-content. As you are a member, could you change that or should I publish an issue there? |
That's the Next.js issue: vercel/next.js#9890 But since Next.js is quite popular, I think it does make sense to update the docs. Thanks for the suggestion! Done 👍 |
My project and steps to reproduce the problem
I want to use SweetAlert with the theme entitled "borderless". I was coding my project with it but I realised it wasn't working, so I built a new nextjs project with the following code:
I have executed the following commands, in that order:
Here is my
package.json
:What's not working?
Swal is working, but the theme is the one by default. I don't know why the borderless theme is not used by Swal whereas it is installed, and the css file is imported in
_app.js
.Expected behavior
I want to have the same behavior as on the documentation when I enable the borderless theme.
Live demo
You can reproduce easily a demo on your own computer, I have written the whole source code above.
The text was updated successfully, but these errors were encountered: