0

I get a compilation error when I import "@shopify/polaris/styles.css";

This is a picture of the error: enter image description here

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!

4

3 回答 3

1

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

于 2018-10-24T15:07:00.680 回答
0

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";"

<link rel="stylesheet" href="https://sdks.shopifycdn.com/polaris/2.12.1/polaris.min.css" />
于 2018-10-28T20:08:50.157 回答
0

In order to upgrade to Polaris 3.0.0-RC4 from commandline, you can just use npm:

npm install https://github.com/Shopify/polaris-react.git#78946cfa2b75592a5ccc536bf2176be8dadb1bfa --save-dev
于 2018-10-28T20:30:30.187 回答