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

Error after update for NextJs 12 #90

Closed marvingbh closed 2 years ago

marvingbh commented 2 years ago

I'm getting this error after the update for NEXT 12.

antd/lib/config-provider/style/index.less:2
@import '../../style/themes/index';
^

SyntaxError: Invalid or unexpected token
    at Object.compileFunction (node:vm:355:18)
    at wrapSafe (node:internal/modules/cjs/loader:1022:15)
    at Module._compile (node:internal/modules/cjs/loader:1056:27)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1121:10)
    at Module.load (node:internal/modules/cjs/loader:972:32)
    at Function.Module._load (node:internal/modules/cjs/loader:813:14)
    at Module.require (node:internal/modules/cjs/loader:996:19)
    at require (node:internal/modules/cjs/helpers:92:18)
    at Object.<anonymous> (../src/node_modules/antd/lib/config-provider/style/index.js:3:1)
    at Module._compile (node:internal/modules/cjs/loader:1092:14) {
  type: 'SyntaxError'
}

config is:

withAntdLess({
    lessVarsFilePath: '/src/styles/antd-custom.less',
    lessVarsFilePathAppendToEndOfContent: false,
    cssLoaderOptions: {},
    webpack(config) {
        return config;
    },
  })

The same code works fine in Next 11. Any clue? Is there something that can I do?

AeShevch commented 2 years ago

+1

Sahejmaharjan1 commented 2 years ago

+1

doonpy commented 2 years ago

+1

SolidZORO commented 2 years ago

I just updated 1.5.1 to be compatible with Next.js 12. more see CHANGELOG.