App reviews, troubleshooting, and recommendations
My apologies, I just realised I posted this to the wrong board. I've reposted in the correct one, but can't see an option to delete this post, so i'm editing it.
Many thanks
Mat
Hi Mat,
It looks like the error is due to trying to read an undefined 'output' property. Here are the top three likely causes:
Dependency Mismatch: Version conflicts after updating Shopify CLI and other dependencies. Try deleting node_modules and reinstalling them. I am going to point to your node modules being they are listed several times.
Configuration File Issues: Check your webpack.config.js or vite.config.js for any incorrect or outdated settings.
Local vs. Global CLI Installation: Uninstall the local Shopify CLI and reinstall it globally to prevent conflicts.
Edit: I would focus on one area at a time, to not break any code, I know how fickle things can be when you start changing the back end, I would focus on the simple stuff first, double checking things and seeing if there are any obvious conflicts. Make back ups before changing anything to not lose any progress so you can revert back if things go wrong.
Let me know how it goes!
Best regards,
Marc
Thanks for your response.
I did already try deleting node_modules in all 3 locations (root, /web and /web/frontend to no avail).
I checked the Shopify docs and although global installation is now the recommendation, there's a section all about how to have a local installation instead and why you might do this, so I think it should be ok to have it local - it always worked until I tried to update, but then I rolled back and I get the same error.
I will check webpack.config.js and/or vite.config.js as you suggested before running a global install as I'd prefer to keep a local installation if possible.
Many thanks
Mat
Hi Mat,
I understand your preference to keep the CLI locally installed.
Since reinstalling node_modules didn’t help, here are some further steps to consider:
Inspect Configuration Files
Double-check webpack.config.js or vite.config.js for any references to output. Ensure all variables and objects are defined correctly, especially if you’ve updated dependencies recently.
Review Dependencies
Run npm ls to inspect the dependency tree and look for any version conflicts or missing packages that might be causing issues. It’s worth aligning critical packages like react, react-dom, or webpack to ensure they’re compatible with your Shopify CLI version.
Clear Caches
Try clearing any build caches (e.g., Vite's .vite directory or Webpack's cache) and remove old build artifacts (dist, build, etc.). This will force a clean build and eliminate potential conflicts.
Verify Environment Variables
Double-check your .env files to ensure all variables are correctly set and consistent across environments. An undefined environment variable could cause this error during build or runtime.
Stack Trace Examination
The stack trace might point to specific files or modules. Enable verbose logging in your build process to get more detailed insights into where the issue might lie.
Minimal Reproduction
As a last step, you could create a minimal app using the local Shopify CLI (shopify app create node) and compare its configuration files to spot any discrepancies.
Best regards,
Marc
Starting a B2B store is a big undertaking that requires careful planning and execution. W...
By JasonH Sep 23, 2024By investing 30 minutes of your time, you can unlock the potential for increased sales,...
By Jacqui Sep 11, 2024We appreciate the diverse ways you participate in and engage with the Shopify Communi...
By JasonH Sep 9, 2024