Skip to content

Fix: Changing Conditions for nextjsProjectExists#188

Open
DhairyaMajmudar wants to merge 2 commits intovercel:masterfrom
DhairyaMajmudar:init
Open

Fix: Changing Conditions for nextjsProjectExists#188
DhairyaMajmudar wants to merge 2 commits intovercel:masterfrom
DhairyaMajmudar:init

Conversation

@DhairyaMajmudar
Copy link

Changed the conditions from checking if package.json exists or not to next.config.mjs exists in the command/inti/index.ts file

Closes #187

@DhairyaMajmudar
Copy link
Author

@nicoalbanese pls. have a look : )

Copy link
Collaborator

@nicoalbanese nicoalbanese left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey! Can you update this to look for any file that has next.config.*

This is because a next config could be .js
https://nextjs.org/docs/pages/api-reference/next-config-js

@DhairyaMajmudar
Copy link
Author

@nicoalbanese I have committed the suggested changes.

@diagomike
Copy link

also in \src\commands\add\auth\lucia\utils.ts - line 231-234

const path = "next.config.mjs";
  const ncExists = existsSync(path);
  if (!ncExists) {
    console.log("Could not find `next.config.mjs`. Please update it manually.");
  }

while setting up lucia authentication - it assumes only .config.mjs - for a complete fix addressing this too might be nice

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Edge Case - Next project not created and init command working.

3 participants