DouyinFE / semi-design

🚀A modern, comprehensive, flexible design system and React UI library. 🎨 Provide more than 2800+ Design Tokens, easy to build your design system. Make Semi Design to Any Design. 🧑🏻‍💻 Design to Code in one click

Home Page:https://semi.design

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[BUG] ESM support for @semi/next

shanliangc opened this issue · comments

Is there an existing issue for this?

  • I have searched the existing issues

Which Component

nextjs config

Semi Version

2.56.3

Current Behavior

Hi, I am trying semi-ui with nextjs framework
NextConfig code is like:

/** @type {import('next').NextConfig} */

import SemiNextConfig from "@douyinfe/semi-next";

const semi = SemiNextConfig({
  omitCss: true,
});

const nextConfig = {
  transpilePackages: [
    "@douyinfe/semi-ui",
    "@douyinfe/semi-icons",
    "@douyinfe/semi-illustrations",
  ],
};

export default semi(nextConfig);
// export default nextConfig;

while it compiles fail.

file:///Users/shanliangchen/Development/frontend/max-airdrop/next.config.mjs:5
const semi = SemiNextConfig({
             ^

TypeError: SemiNextConfig is not a function
    at file:///Users/shanliangchen/Development/frontend/max-airdrop/next.config.mjs:5:14
    at ModuleJob.run (node:internal/modules/esm/module_job:218:25)
    at async ModuleLoader.import (node:internal/modules/esm/loader:329:24)
    at async importModuleDynamicallyWrapper (node:internal/vm/module:431:15)
    at async loadConfig (/Users/shanliangchen/Development/frontend/max-airdrop/node_modules/next/dist/server/config.js:698:36)
    at async Module.nextDev (/Users/shanliangchen/Development/frontend/max-airdrop/node_modules/next/dist/cli/next-dev.js:175:14)

Node.js v20.11.0
(base) 

with info TypeError: SemiNextConfig is not a function. I am sure that SemiNextConfig is indeed a function.

How can I fix that? Thanks for your help

Expected Behavior

Just works normally with custom theme.

Steps To Reproduce

No response

ReproducibleCode

No response

Environment

- "@douyinfe/semi-next": "^2.56.3",
- "@douyinfe/semi-ui": "^2.56.3",
- "next": 14

Anything else?

No response