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.

Incomplete installation instructions

See original GitHub issue

First of all i’ll like to say good work keeping sweetalert alive. I’ve been using the old sweetalert library via cdn. i can’t really remember how i came across your fork.

I don’t know if i’m missing something but the installation instructions seem to be incomplete. After importing the module with

import { default as swal } from 'sweetalert2'.

It’s not documented that you also have to import/require the css files so all the styles and buttons can be loaded also. In my case with npm. It was a simple.

import './node_modules/sweetalert2/dist/sweetalert2.css'

Ideally i feel it would make more sense if i just imported swal and internally the css has already been imported. because i don’t think anyone would want to use sweetalert2 without the buttons and the css.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:13
  • Comments:13 (7 by maintainers)

github_iconTop GitHub Comments

4reactions
toveruxcommented, Jan 26, 2017

I agree, we really should document the styles part.

Don’t forget that import 'sweetalert2/dist/sweetalert2.css'; is specific to module bundlers (for example Webpack) so we can’t just put “import the CSS file using an import statement” on the README, or we may confuse a lot of users. I already see those issues such as “I’ve imported the CSS with import but it says syntax error, please fix your syntax yo”. The fact is, it’s difficult to document every build systems on earth, because something like <link rel="stylesheet" type="text/css" href="node_modules/sweetalert2/etc.css" /> is also a solution for others.

I’m really in favor of embedding the styles into the library, that would make the things much simpler and we could benefit of tree-shaking on the styles too (once the library has the right structure for this). But we also have users that use our SCSS source, so this approach has downsides too.

because i don’t think anyone would want to use sweetalert2 without the buttons and the css.

😂 At least we have a DIY version.

2reactions
danidee10commented, Jan 27, 2017

@toverux but at least we should have a section, that says

“don’t forget to import the stylesheet sweetalert2.css” or something similar

or maybe a FAQ section to answer the question of “sweetalert2 styles are not working”

My point is there should be something in the docs that gives a pointer to the css file, even though it’s not bundler specific.

Read more comments on GitHub >

github_iconTop Results From Across the Web

‎Installation incomplete | Trend Micro Home Users Community
Installation incomplete. Hi all, i used trend micro ... You may check the link below for instructions on how to install the permission...
Read more >
Incomplete Installation Instructions · Issue #513 · SeriousCache ...
I'm trying to build this project using Visual Studio, but your instructions leave a lot as assumed knowledge. Please provide actual step instructions....
Read more >
"Installation incomplete. Some products failed to install." due ...
"Installation incomplete. Some products failed to install." due to error code 1603 when installing Autodesk 2020 or 2021 version software.
Read more >
Installation Incomplete. Some Products Failed to Install. F/X ...
An issue with the Autodesk Licensing Service is interfering with the installation. Solution. Step 1: Download and run the AdskLicensing ...
Read more >
Flight Simulator X: “An error occurred while attempting to ...
The problem may be due to an incomplete installation of the application” when you try to ... Follow the instructions to reinstall Flight...
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