SolidZORO / next-plugin-antd-less

🎩 Use Antd (Less) with Next.js v12, Zero Dependency on other Next-Plugins.
MIT License
345 stars 48 forks source link

Make it work serverless #11

Closed FckYeah closed 3 years ago

FckYeah commented 3 years ago

The serverless build will fail with error TypeError: (0 , _styleChecker.isStyleSupport) is not a function. I used a solution from this issue: https://github.com/vercel/next.js/issues/8151

I don't know how it would affect the server build if we use an extended regex without any conditions. At least it buildable :D So, I made the condition just in case.

jonioni commented 3 years ago

Any good solution? Encountered the same issue when target is set to serverless (Next.js 10.1.x, Webpack 4):

module.exports = withAntdLess({
  target: "serverless",
  modifyVars: { ... },
})
TypeError: (0 , _styleChecker.canUseDocElement) is not a function