It looks like the error you encountered may be related to the useContext function in React. This function is a hook that allows you to use context without wrapping a component in a Context.Consumer. The error message “Cannot read properties of null (reading ‘useContext’)” indicates that the context you’re trying to access is null.
Here are a few potential causes for this error:
You’re trying to use the hook outside of a functional component. Hooks can only be used inside the body of a function component.
The context you’re trying to use is not properly defined or not correctly imported into the component where you’re trying to use it.
The versions of React and other related packages are not compatible. You may need to update or downgrade certain packages to ensure compatibility.
You could try:
Checking if the context is correctly defined and imported in your component.
Ensuring that you’re using the useContext hook inside a functional component.
Updating your version of React and other related packages, or downgrading if necessary.
It would also be beneficial to check the Gadget.dev tutorial again to ensure you have correctly followed all the steps. If the error persists, it might be a good idea to reach out to the Gadget Discord community forum for more specific help.
It looks like the error you encountered may be related to the useContext function in React. This function is a hook that allows you to use context without wrapping a component in a Context.Consumer. The error message “Cannot read properties of null (reading ‘useContext’)” indicates that the context you’re trying to access is null.
Here are a few potential causes for this error:
You’re trying to use the hook outside of a functional component. Hooks can only be used inside the body of a function component.
The context you’re trying to use is not properly defined or not correctly imported into the component where you’re trying to use it.
The versions of React and other related packages are not compatible. You may need to update or downgrade certain packages to ensure compatibility.
You could try:
Checking if the context is correctly defined and imported in your component.
Ensuring that you’re using the useContext hook inside a functional component.
Updating your version of React and other related packages, or downgrading if necessary.
It would also be beneficial to check the Gadget.dev tutorial again to ensure you have correctly followed all the steps. If the error persists, it might be a good idea to reach out to the Gadget Discord community forum for more specific help.
I can report that we too are experiencing this error using the same majors versions of Shopify packages that were once working in the past for sure. When running the shopify app dev command on the following versions we are getting the same error. Meanwhile, the shopify app build command works just fine.