I get a compilation error when I import "@shopify/polaris/styles.css";
This is a picture of the error:
But whenever I go in to the styles.css, and do a search for the line that errors out, it doesn’t find it so it seems like as though that line doesn’t exist. Any help would be great. Thanks!
If you don’t want to upgrade as the previous answer suggested, you can also just add the direct CSS link in your html file and remove the “import “@shopify/polaris/styles.css”;”
4
Answers
This was a known issue as detailed on the following issue:
https://github.com/Shopify/polaris/issues/441
Upgrade to the next version (3.0.0-RC3) and it should be fine
If you don’t want to upgrade as the previous answer suggested, you can also just add the direct CSS link in your html file and remove the “import “@shopify/polaris/styles.css”;”
In order to upgrade to Polaris 3.0.0-RC4 from commandline, you can just use npm:
If you’re in 2022, and getting the same error that’s because they moved it again. Use this in your AppProvider component.
import "@shopify/polaris/build/esm/styles.css";