Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] ESM support for @semi/next #2195

Open
1 task done
shanliangc opened this issue Apr 22, 2024 · 0 comments
Open
1 task done

[BUG] ESM support for @semi/next #2195

shanliangc opened this issue Apr 22, 2024 · 0 comments

Comments

@shanliangc
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant