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

Module not found: Can't resolve 'antd/lib/qr-code' #52703

Closed
1 task done
zombieJ opened this issue Jul 15, 2023 · 7 comments
Closed
1 task done

Module not found: Can't resolve 'antd/lib/qr-code' #52703

zombieJ opened this issue Jul 15, 2023 · 7 comments
Labels
bug Issue was opened via the bug report template. create-next-app Related to our CLI tool for quickly starting a new Next.js application. locked

Comments

@zombieJ
Copy link

zombieJ commented Jul 15, 2023

Verify canary release

  • I verified that the issue exists in the latest Next.js canary release

Provide environment information

Operating System:
      Platform: linux
      Arch: x64
      Version: #22 SMP Tue Jan 10 18:39:00 UTC 2023
    Binaries:
      Node: 16.17.0
      npm: 8.15.0
      Yarn: 1.22.19
      pnpm: 7.1.0
    Relevant Packages:
      next: 13.4.10-canary.8
      eslint-config-next: 13.4.10
      react: 18.2.0
      react-dom: 18.2.0
      typescript: 5.1.6
    Next.js Config:
      output: N/A


warn  - Latest canary version not detected, detected: "13.4.10-canary.8", newest: "13.4.10".
        Please try the latest canary version (`npm install next@canary`) to confirm the issue still exists before creating a new issue.
        Read more - https://nextjs.org/docs/messages/opening-an-issue

Which area(s) of Next.js are affected? (leave empty if unsure)

CLI (create-next-app)

Link to the code that reproduces this issue or a replay of the bug

https://codesandbox.io/p/github/alyosha-30emeciel/antd-qrcode-bug/csb-6xksxs/draft/happy-burnell?file=/package.json:18,20

To Reproduce

just run npm start

Describe the Bug

截屏2023-07-15 10 08 05

Expected Behavior

QRCode path should be qrcode, not qr-code. NextJS convert to the wrong path.

Which browser are you using? (if relevant)

No response

How are you deploying your application? (if relevant)

No response

@zombieJ zombieJ added the bug Issue was opened via the bug report template. label Jul 15, 2023
@github-actions github-actions bot added the create-next-app Related to our CLI tool for quickly starting a new Next.js application. label Jul 15, 2023
@naveen8801
Copy link

naveen8801 commented Jul 15, 2023

Hi @zombieJ, I'd like to check this, is this issue open?

@zombieJ
Copy link
Author

zombieJ commented Jul 15, 2023

@naveen8801 Please feel free to help on this : )

@naveen8801
Copy link

naveen8801 commented Jul 15, 2023

@zombieJ, I think I have found exact reason behind this behavior. Please check config.ts here and example for this config is here

kebabCase related change was introduced 2 weeks ago PR link

I tried removing kebabCase which resulted in same error for other imports e.g ConfigProvider

@alyosha-30emeciel
Copy link

May I try to add an exception in my project's 'next.config.js' file as a workaround ?
I'm not sure about how it works. Maybe this?

/** @type {import('next').NextConfig} */
const nextConfig = {
    modularizeImports: {
        'antd/lib/QRCode': {
            transform: 'antd/lib/qrcode',
        },
    },
}

module.exports = nextConfig

@zombieJ
Copy link
Author

zombieJ commented Jul 17, 2023

In most case, naming can be kebabCase. But QRCode is not kebabCase as qr-code in antd path.

@balazsorban44
Copy link
Member

Related/duplicate issue: #52307 I'm going to close this in favor, feel free to comment further there!

@github-actions
Copy link
Contributor

This closed issue has been automatically locked because it had no new activity for 2 weeks. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue was opened via the bug report template. create-next-app Related to our CLI tool for quickly starting a new Next.js application. locked
Projects
None yet
Development

No branches or pull requests

4 participants