Open Dentrax opened 2 years ago
this is for working with the native node.js require
only. In next.js it's using webpack to compile and bundle .js for the browser, so it wouldn't work there.
I have just followed these instructions to set up a nextjs project and I get the same error.
1. Have vscode open with terminal gitbash open - pointing at the c:\apps 2. Running create nextjs project from cmder.
steps (From cmder): 2.1 npx create-next-app@latest projectname --typescript
Need to install the following packages:
create-next-app
Ok to proceed? (y) y
√ Would you like to use ESLint with this project? ... No / Yes
√ Would you like to use src/
directory with this project? ... No / Yes
√ Would you like to use experimental app/
directory with this project? ... No / Yes
√ What import alias would you like configured? ... @/*
same error Import trace for requested module: ./node_modules/next/dist/shared/lib/router/utils/is-bot.js ./node_modules/next/dist/shared/lib/router/router.js ./node_modules/next/dist/client/router.js ./node_modules/next/dist/client/dev/on-demand-entries-client.js
./node_modules/next/dist/shared/lib/router/utils/is-dynamic.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:
I found the solution: First when creating the project with npm run dev I need to do it from vscode I think there is something in nextjs which recognises the a temporary directory from vscode has been opened and it expects the command coming from that.
Any finally:
Any ideas on this? @jchip 🤔