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

Add JS wrapper to CSS to support Serverless target #297

Merged
merged 1 commit into from
Jun 21, 2020

Conversation

iaincollins
Copy link
Member

Resolves #281

Using the 'Serverless' target on in Next.js on some platforms does not work if you try to read in files at runtime that are not JavaScript or JSON (e.g. CSS files), as discussed in #281

To work around this issue, this script is a manual step that wraps the compiled CSS (e.g. used for sign in / error pages) that is output by PostCSS by n a JavaScript file that has the CSS embedded in it, and exports a function that returns that CSS as a string.

This way the CSS is included in a .js file and won't cause problems with the Serverless target.

@iaincollins iaincollins added bug Something isn't working enhancement New feature or request labels Jun 21, 2020
@iaincollins iaincollins added this to the 2.0 Release milestone Jun 21, 2020
@vercel
Copy link

vercel bot commented Jun 21, 2020

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/iaincollins/next-auth-docs/i7tswx2pr
✅ Preview: https://next-auth-docs-git-feature-support-serverless-target.iaincollins.vercel.app

@iaincollins iaincollins merged commit 52f2dd5 into main Jun 21, 2020
@iaincollins iaincollins deleted the feature/support-serverless-target branch June 21, 2020 14:07
@iaincollins
Copy link
Member Author

Published as next-auth@2.0.0-beta.86

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2.0.0-beta.78 - Next target set to serverless causes [...next-auth] to fail
1 participant