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' #43572

Closed
alyosha-30emeciel opened this issue Jul 15, 2023 · 5 comments · Fixed by #43607
Closed

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

alyosha-30emeciel opened this issue Jul 15, 2023 · 5 comments · Fixed by #43607

Comments

@alyosha-30emeciel
Copy link

Reproduction link

https://github.com/alyosha-30emeciel/antd-qrcode-bug

Steps to reproduce

npm run dev
-> browse to http://localhost:3000
-> ./src/app/page.tsx:3:0
Module not found: Can't resolve 'antd/lib/qr-code'

What is expected?

The firt example from ./src/app/page.tsx:3:0
Module not found: Can't resolve 'antd/lib/qr-code' with a QRCode runs.

What is actually happening?

./src/app/page.tsx:3:0
Module not found: Can't resolve 'antd/lib/qr-code'
1 | 'use client'
2 | import React from 'react';

3 | import {Input, QRCode, Space} from "antd";
4 |
5 | export default function Home() {
6 | const [text, setText] = React.useState('https://ant.design/');

https://nextjs.org/docs/messages/module-not-found

Environment Info
antd 5.7.0
React 18.2.0
System node 20.4.2
Browser chrome 114.0.5735.199

I created the example with:
1/ npx create-next-app@latest
2/ then followed antd's Getting Started

@alyosha-30emeciel
Copy link
Author

@zombieJ
Copy link
Member

zombieJ commented Jul 15, 2023

NextJS convert QRCode to qr-code path but its qrcode in antd. Seems need report to nextjs for this case.

@zombieJ
Copy link
Member

zombieJ commented Jul 15, 2023

Create the issue to the NextJS: vercel/next.js#52703

@afc163
Copy link
Member

afc163 commented Jul 15, 2023

@zombieJ Is it same bug in babel-plugin-import?

@MadCcc
Copy link
Member

MadCcc commented Jul 17, 2023

@zombieJ Is it same bug in babel-plugin-import?

QRCode is provided after v5, so there's no conflict with bable-plugin-import.

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

Successfully merging a pull request may close this issue.

4 participants