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

Import trace for requested module error even in new project #55329

Open
1 task done
abdorabee opened this issue Sep 13, 2023 · 9 comments
Open
1 task done

Import trace for requested module error even in new project #55329

abdorabee opened this issue Sep 13, 2023 · 9 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. Navigation Related to Next.js linking (e.g., <Link>) and navigation. Runtime Related to Node.js or Edge Runtime with Next.js. Upstream Related to using Next.js with a third-party dependency. (e.g., React, UI/icon libraries, etc.).

Comments

@abdorabee
Copy link

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

https://github.com/abdorabee/saas

To Reproduce

Create a new Next.js project.
Run the development server.
Open the browser and navigate to the project's homepage.
You should see the error message "Import trace for requested module:" in the console.

Current vs. Expected behavior

The project should start without any errors.

vs

The project starts, but the error message "Import trace for requested module:" is displayed in the console.

Verify canary release

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

Provide environment information

Operating System:
      Platform: win32
      Arch: x64
      Version: Windows 10 Pro
    Binaries:
      Node: 20.6.1
      npm: N/A
      Yarn: N/A
      pnpm: N/A
    Relevant Packages:
      next: 13.4.20-canary.26
      eslint-config-next: 13.4.19
      react: 18.2.0
      react-dom: 18.2.0
      typescript: 5.2.2
    Next.js Config:
      output: N/A

Which area(s) are affected? (Select all that apply)

App Router, CLI (create-next-app), Middleware / Edge (API routes, runtime), Operating System (Windows, MacOS, Linux), Package manager (npm, pnpm, Yarn), Routing (next/router, next/navigation, next/link)

Additional context

I am getting the error "Import trace for requested module:" even in a new Next.js project that doesn't have any packages installed yet.

@abdorabee abdorabee added the bug Issue was opened via the bug report template. label Sep 13, 2023
@github-actions github-actions bot added create-next-app Related to our CLI tool for quickly starting a new Next.js application. Runtime Related to Node.js or Edge Runtime with Next.js. area: OS Navigation Related to Next.js linking (e.g., <Link>) and navigation. labels Sep 13, 2023
@shiroyasha9
Copy link

I tried running the repo on my system but did not get any such error. Can you elaborate more, and attach screenshots?

@YasielCabrera
Copy link

I'm also getting a lot of Import trace for requested module: in the console. I'm using next 13.5.1 and I believe some of those logs are related to @mui/material which I have the version "@mui/material": "^5.13.0",

These are some of the logs:

Import trace for requested module:
__barrel_optimize__?names=useTheme!=!./node_modules/@mui/material/index.js
./components/CustomToaster/CustomToaster.tsx
./providers/GlobalProviders.tsx

__barrel_optimize__?names=useTheme!=!./node_modules/@mui/material/index.js
The requested module '__barrel_optimize__?names=useTheme&wildcard!=!./Stack' contains conflicting star exports for the name '__esModule' with the previous requested module '__barrel_optimize__?names=useTheme&wildcard!=!./utils'

I see those lines duplicated a lot of times in the console, also for other components

@imceZZ
Copy link

imceZZ commented Sep 20, 2023

I am encountering the same thing with MUI

@muhammedogz
Copy link

It would be related with this issue: #55663

@abdorabee
Copy link
Author

abdorabee commented Sep 21, 2023

I tried running the repo on my system but did not get any such error. Can you elaborate more, and attach screenshots?

after several trials I solved the problem by uninstalling nodejs completely and the cache then installing it again and it started working perfectly fine , it seems a lot of people encountering this problem too
Screenshot_2023-09-16_192628

@iRoySwift
Copy link

截屏2023-09-27 14 28 49

Darwin RacheldeMacBook-Pro.local 22.6.0 Darwin Kernel Version 22.6.0: Wed Jul 5 22:21:56 PDT 2023; root:xnu-8796.141.3~6/RELEASE_X86_64 x86_64

nodejs:v18.17.0
npm:9.6.7

"@emotion/cache": "^11.11.0",
"@emotion/react": "^11.11.1",
"@emotion/styled": "^11.11.0",
"@mui/icons-material": "^5.14.9",
"@mui/material": "^5.14.10",
"@mui/utils": "^5.14.10",

@LostArrows27
Copy link

i have same issue when it still not give any error and 1 day, it gives me a bunch of warning import like yours. I fixed that by delete my whole folder and reinstall my code reposity in another path in my computer

@rightson1
Copy link

Had the same issue, i deleted node js, yarn cache , npm cache, changed project name. Its working now

@balazsorban44 balazsorban44 added Upstream Related to using Next.js with a third-party dependency. (e.g., React, UI/icon libraries, etc.). and removed area: OS labels Apr 17, 2024
@Vinod-Kumar-Mehto
Copy link

I had the same problem, and it came out that I was using the start value to align some items in flex elements.

.container {
max-width: 840px;
margin: auto;
padding: 20px;
display: flex;
flex-direction: column;
align-items: start;
min-height: 100vh;
}

I changed the align-items value to flex-start and the warning disappeared.

.container {
max-width: 840px;
margin: auto;
padding: 20px;
display: flex;
flex-direction: column;
align-items: flex-start;
min-height: 100vh;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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. Navigation Related to Next.js linking (e.g., <Link>) and navigation. Runtime Related to Node.js or Edge Runtime with Next.js. Upstream Related to using Next.js with a third-party dependency. (e.g., React, UI/icon libraries, etc.).
Projects
None yet
Development

No branches or pull requests

10 participants