Questions and discussions about using the Shopify CLI and Shopify-built libraries.
I have not been able to access the new Text component offered by the Shopify Polaris library. I am getting the following import error:
The requested module '/node_modules/.vite/deps/@shopify_polaris.js?v=e5492b37' does not provide an export named 'Text'
Any ideas on how to resolve this? The other text components are all deprecated and I'm using the latest version of Polaris.
Hello there
Polaris is a design system and React component library provided by Shopify. To import beta components in Polaris, you can follow these steps:
npm install @Shopify/polaris
import { BetaBadge } from '@shopify/polaris';
Note that beta components are not considered stable and may be subject to change. Therefore, it is recommended to use them with caution in production environments.
hope this helps!
If this fixed your issue, likes and accepting as a solution are highly appreciated
| Build an online presence with our custom-built Shopify Theme: EcomifyTheme
| Check out our reviews: Trustpilot Reviews
| We are Shopify Partners: EcomGraduates Shopify Partner
Restarting the development server did it for me... 🙂
I had this same issue. Previous answers did not help. There's not a special way to import beta components. You just need to make sure you are using the correct release, and then delete the node_modules because that is storing your old deps. Here's what worked for me:
Open the web/frontend/package.json
file in your project.
Locate the @Shopify/polaris
package under the dependencies
section, and update its version to the latest available version. For example, you can update it to version 10.41.0 by changing the line to "@shopify/polaris": "^10.41.0"
.
Save the changes to the package.json
file.
Delete the node_modules
folder in your project.
Restart your development server.
Verify that the @Shopify/polaris
package has been installed with the correct version by checking the package-lock.json
file or running the npm list
command.
Hope this helps!
This worked perfectly!
Important Steps:
1. Deleting the node_modules
2. Running npm install
3. Then restarting with "npm run dev -- --reset" did the trick 👍