vercel / next-plugins

Official Next.js plugins
MIT License
2.68k stars 319 forks source link

less config error #696

Closed dengnan123 closed 3 years ago

dengnan123 commented 3 years ago

next.config.js

const withCss = require('@zeit/next-css')
const withLess = require('@zeit/next-less')
module.exports = withCss({
  cssModules: true,
  ...withLess({
    lessLoaderOptions: {
      javascriptEnabled: true,
    },
  })
})

get error

TypeError: Cannot set property 'styles' of undefined
    at module.exports (/Users/dany/Desktop/low-code/Jinghong/packages/frontend/node_modules/@zeit/next-css/css-loader-config.js:25:56)
    at Object.webpack (/Users/dany/Desktop/low-code/Jinghong/packages/frontend/node_modules/@zeit/next-css/index.js:15:36)
    at getBaseWebpackConfig (/Users/dany/Desktop/low-code/Jinghong/packages/frontend/node_modules/next/dist/build/webpack-config.js:162:454)
    at async Promise.all (index 0)
    at async HotReloader.start (/Users/dany/Desktop/low-code/Jinghong/packages/frontend/node_modules/next/dist/server/hot-reloader.js:16:133)
    at async DevServer.prepare (/Users/dany/Desktop/low-code/Jinghong/packages/frontend/node_modules/next/dist/server/next-dev-server.js:16:453)
    at async /Users/dany/Desktop/low-code/Jinghong/packages/frontend/node_modules/next/dist/cli/next-dev.js:22:1
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
leerob commented 3 years ago

This repository and plugins are deprecated (see README) 👍