elado / next-with-less

Next.js + Less CSS Support
MIT License
143 stars 24 forks source link

Variable @var-name is undefined on Next 13 with page folder #38

Open michaelpetri opened 10 months ago

michaelpetri commented 10 months ago

I'm currently trying to migrate from next-plugin-antd-less to this packages, since next-plugin-antd-less isn't working anymore for me since next 13.

Anyway, with this plugin compiling kinda works again but less-loader always throws such errors:

shop-1  |     padding: @spacing-sm;
shop-1  |            ^
shop-1  |   Variable @spacing-sm is undefined

I use less-vars-to-js to load variables from less file and pass them to this plugin:

  return withPlugins(
    [
      [
        withLess,
        {
          lessOptions: {
            modifyVars: themeVariables
          }
        }
      ],
      [withBundleAnalyzer]
    ],
    nextConfig
  )(phase, ...rest)

I already ensured variables exists and tried to pass them with and without @ prefix.

Any idea?