Nextjs-shopify troubleshooting

I have the builder.io Shopify App running with the nextjs-shopify git project. The folder is successfully connected to my Shopify store, as well as builder.io under the Organization “Accelerate360” > "Builder-IO-LTG-Headless. I am able to run npm run dev, but when I visit localhost:3000, or try to make content edits within builder.io, the builder.io CMS is unable to connect, and the Unix console displays errors. I have tried installing the Builder Chrome Extension, and I know the API credentials are correct because the CMS successfully synced the products. Any help would be greatly appreciated at this time.

The Browser error:

./assets/main.css ((webpack)/css-loader/cjs.js??ref--5-oneOf-6-1!(webpack)/postcss-loader/cjs.js??ref--5-oneOf-6-2!./assets/main.css)
TypeError: Cannot read property 'body' of undefined
at runMicrotasks (<anonymous>)

The console error on localhost:

Unknown error from PostCSS plugin. Your current PostCSS version is 8.2.13, but postcss-preset-env uses 6.0.23. Perhaps this is the source of the error below.
error - ./assets/main.css ((webpack)/css-loader/cjs.js??ref--5-oneOf-6-1!(webpack)/postcss-loader/cjs.js??ref--5-oneOf-6-2!./assets/main.css)
TypeError: Cannot read property 'body' of undefined

Hi jhopper23 , just did a test and wasn’t able to reproduce, please share anything specific about your environment that might cause this error.

Hi Aziz,

I am running nextjs-shopify in Kali Linux on a Windows Subsystem.

4.72-microsoft-standard-WSL2 #1 SMP Wed Oct 28 23:40:43 UTC 2020 x86_64 GNU/Linux

Node Version: 16.1.0
NPM Version: 7.12.1

The console also prints “Using Webpack 4” after starting server on localhost:3000.

Upon visiting localhost:3000, the console displays the PostCSS version error.

Aziz,

There is also the error in the console during a hot-session: “cannot find module build-manifest.json”

This error " cannot find module build-manifest.json " usually means that build has failed and there’s an underlying issue. Things to try to solve this:

  • remove node_modules folder and start a brand new npm install , it that didn’t solve it, was there any errors during the installation process?
  • try using nvm and the latest stable version of npm/node, latest LTS is 14.16.1 , after that repeat step 1 above.
1 Like