How to resolve warnings when running a newly created Next.js application?
P粉019353247
P粉019353247 2024-02-21 22:31:05
0
2
462

I created a new next.js application using npx create-next-app ./ ./ I haven't touched any of the code or even opened it in an editor.

When running this application using npm run dev I get these very long warnings.

$ npm run dev

> test@0.1.0 dev
> next dev

- ready started server on 0.0.0.0:3000, url: http://localhost:3000
- event compiled client and server successfully in 1605 ms (20 modules)
- wait compiling...
- event compiled client and server successfully in 593 ms (20 modules)
- wait compiling /page (client and server)...
- warn ./node_modules/next/dist/client/add-base-path.js
There are multiple modules with names that only differ in casing.
This can lead to unexpected behavior when compiling on a filesystem with other case-semantic.
Use equal casing. Compare these module identifiers:
* javascript/auto|C:\Users\Admin\Desktop\Desktop\WD\NEXTjs\test\test\node_modules\next\dist\compiled\@next\react-refresh-utils\dist\loader.js!C:\Users\Admin\Desktop\Desktop\WD\NEXTjs\test\test\node_modules\next\dist\build\webpack\loaders\next-flight-client-module-loader.js!C:\Users\Admin\Desktop\Desktop\WD\NEXTjs\test\test\node_modules\next\dist\build\webpack\loaders\next-swc-loader.js??ruleSet[1].rules[6].oneOf[4].use[2]!C:\Users\Admin\Desktop\Desktop\WD\NEXTjs\test\test\node_modules\next\dist\client\add-base-path.js|app-client
    Used by 3 module(s), i. e.
    javascript/auto|C:\Users\Admin\Desktop\Desktop\WD\NEXTjs\test\test\node_modules\next\dist\compiled\@next\react-refresh-utils\dist\loader.js!C:\Users\Admin\Desktop\Desktop\WD\NEXTjs\test\test\node_modules\next\dist\build\.................

The page has been loaded.

P粉019353247
P粉019353247

reply all(2)
P粉488464731

I think you just need to delete ./ and run the command.

npx create-next-app@latest

Afterwards, when the command asks for the project name, just write . and press Enter.

P粉340980243

I found the problem. Next.js doesn't like placing the application in the Desktop/desktop/... folder, so it throws an error. I just changed the folder name and it worked.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!