Skip to content
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

Error Upgrading @Shopify/Polaris And React In Shopify App Development #1314

Open
ayushmukho opened this issue Jan 7, 2024 · 2 comments
Open

Comments

@ayushmukho
Copy link

ayushmukho commented Jan 7, 2024

Issue summary

New to Shopify App Development. I was trying SHOPIFY APP CLI with Node. It's Polaris version is 10.49.1. I wanted to upgrade it to the latest (12.1.1) but couldn't. I need to upgrade react as well. Upgrading React to the latest causes new set of problems

  • @shopify/shopify-app-express version: "^2.1.3"
  • Node version: "v20.8.0"
  • Operating system: "macos"

Expected behavior

Updated to the latest polaris version and also the latest react version

Actual behaviour

If we update it breaks everything

@lizkenyon
Copy link
Contributor

Hi there 👋

Thanks for flagging. The team will review this and look into updating some of the dependencies.

If you are new to Shopify development, I would recommend looking into the Remix template. There is a lot more documentationavailable for that template.

@keburius
Copy link

keburius commented Feb 28, 2024

Hello @ayushmukho👋,

I encountered the same issue and resolved it as follows:

  1. Update Polaris to the latest version:
    "@shopify/polaris": "^12.19.2"
  2. Update React and ReactDOM to version 18 or later:
    "react": "^18.2.0", "react-dom": "^18.2.0"

After these updates, I encountered an issue with ReactDOM.render, as it is no longer supported in React 18. To address this, I switched to using createRoot instead:

`import { createRoot } from "react-dom/client";
import App from "./App";
import { initI18n } from "./utils/i18nUtils";

initI18n().then(() => {
const root = createRoot(document.getElementById("app"));
root.render();
});`

I hope this helps you! 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants