Next.js Discord

Discord Forum

getting error while using ANTD, on NEXT : 14.1.4,

Unanswered
Japanese Bobtail posted this in #help-forum
Open in Discord
Avatar
Japanese BobtailOP
I am getting the below error while using antd (^5.16.2) . Here is the issue
export var preMessage = function preMessage(fn) {
^^^^^^

SyntaxError: Unexpected token 'export'

please see the screenshot for more details.

I tired adding antd on transpilePackages too.
/** @type {import('next').NextConfig} */
const nextConfig = {
    transpilePackages: ['ui',"@ant-design/icons", "antd"],
    webpack(config) {
        config.module.rules.push({
            test: /\.svg$/i,
            issuer: /\.[jt]sx?$/,
            use: ['@svgr/webpack'],
        })
        return config
    },
};

export default nextConfig;


will be appreciating your help and suggestion.
Image

0 Replies