TypeError: Cannot read property 'insertAfter' of undefined

2k Views Asked by At

When i try to run the frontend of my project (which is in next.js) with 'yarn dev', it throws me this error:

error - ./node_modules/next/dist/compiled/css-loader/cjs.js??ruleSet[1].rules[2].oneOf[6].use[1]!./node_modules/next/dist/compiled/postcss-loader/cjs.js??ruleSet[1].rules[2].oneOf[6].use[2]!./styles/global.css

TypeError: Cannot read property 'insertAfter' of undefined

according to what I've found until now, the error is most probably related to webpack I've found similar issues (not the exact issue) here on:

https://github.com/vercel/next.js/issues/23795

and

https://github.com/thetinywebagency/thetinywebagency.github.io/issues/1

Solutions mentioned in these 2 links didn't help in my case. If someone has solved the problem, assist needed...

1

There are 1 best solutions below

0
Cavein Muthama On

The problem is related to tailwind error - ./node_modules/next/dist/compiled/css-loader/cjs.js??ruleSet[1].rules[2].oneOf[6].use[1]!./node_modules/next/dist/compiled/postcss-loader/cjs.js??ruleSet[1].rules[2].oneOf[6].use[2]!./styles/global.css

check your ./styles/global.css