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

feat: warn for incompat nextauth url and port #1596

Closed

Conversation

juliusmarminge
Copy link
Member

@juliusmarminge juliusmarminge commented Oct 15, 2023

Supersedes #1591

@vercel
Copy link

vercel bot commented Oct 15, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
create-t3-app ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 16, 2023 7:14am
t3-upgrade ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 16, 2023 7:14am

@changeset-bot
Copy link

changeset-bot bot commented Oct 15, 2023

🦋 Changeset detected

Latest commit: b3ddb87

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
create-t3-app Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@juliusmarminge
Copy link
Member Author

Current dependencies on/for this PR:

This comment was auto-generated by Graphite.

Comment on lines 12 to 15
console.warn(
`NEXTAUTH_URL (${env.NEXTAUTH_URL}) doesn't match with PORT (${env.PORT})`
);
Copy link
Member Author

Choose a reason for hiding this comment

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

is logging the right thing or should it be a hard throw?

Copy link
Member

Choose a reason for hiding this comment

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

imo throw. logs are easy to miss, and if someone really wants to develop with a port that doesn't match their nextauth url (can't imagine this) they can always turn it off.

@juliusmarminge
Copy link
Member Author

CleanShot 2023-10-16 at 08 32 57@2x

Changed to erroring @c-ehrlich

@juliusmarminge juliusmarminge added 🚀 autorelease add this label to a pr to trigger a beta release and removed 🚀 autorelease add this label to a pr to trigger a beta release labels Oct 16, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Oct 16, 2023

A new create-t3-app prerelease is available for testing. You can install this latest build in your project with:

pnpm create [email protected]

@github-actions github-actions bot removed the 🚀 autorelease add this label to a pr to trigger a beta release label Oct 16, 2023
@juliusmarminge
Copy link
Member Author

juliusmarminge commented Oct 16, 2023

Hmm looks like process.env.PORT isn't always defined which causes some issues 🤔

CleanShot 2023-10-16 at 09 26 10@2x

Looks like they only set this if they are the one overriding the default:

CleanShot 2023-10-16 at 09 28 51@2x


So to summarize, this will work if you run pnpm dev and next overrides your port, but not if you manually specify it yourself using the --port 3001 flag. Will post an issue on next and see if they want to always set this env


EDIT: actually looks like they do set it but not immediately?

CleanShot 2023-10-16 at 09 33 03@2x

@c-ehrlich
Copy link
Member

closing for now since it doesn't seem possible to achieve this without having it run on every request. would still be nice to find a way to do this in the future / if next changes their behaviour on this

@c-ehrlich c-ehrlich closed this Oct 25, 2023
@juliusmarminge juliusmarminge deleted the 10-16-warn_for_incompat_nextauth_url_and_port branch November 1, 2023 21:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📌 area: cli Relates to the CLI 📌 area: t3-app Relates to the generated T3 App
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants