Talal Mughal
Talal Mughal

Reputation: 1

TypeError: Cannot read property 'insertAfter' of undefined

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...

Upvotes: -1

Views: 2973

Answers (3)

Spock
Spock

Reputation: 2741

Late to the party, but for me it was a missing semi-colon at the end of a tailwind @apply line.

Upvotes: 1

Harun Kadri YARKA
Harun Kadri YARKA

Reputation: 1

Chek your styles.scss

find this line : @apply text-surface;

and do this or delete

//@apply text-surface;

Upvotes: 0

Cavein Muthama
Cavein Muthama

Reputation: 35

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

Upvotes: 0

Related Questions