Hi guys our production sitecrashed few hours ago and these are the console erros. It was working fine 2 hours ago, i rebuilt it with a new commit (totally unrelated to next-auth) and then the site's auth stopped working π¦
#Unexpected token : export , in next-auth. Site crashes
58 messages Β· Page 1 of 1 (latest)
π This post has been indexed in our web forum and will be seen by search engines so other users can find it outside Discord
π΅οΈ Your user profile is private by default and won't be visible to users outside Discord, if you want to be visible in the web forum you can add the "Public Profile" role in <id:customize>
β
You can mark a message as the answer for your post with `Right click -> Apps -> Mark Solution`
(if you don't see the option, try refreshing Discord with Ctrl + R)
I reverted to a commit from last month locally, i still get that same error, what could possibly cause this? is this related to some upstream change?
@harsh falcon sorry to ping you man! but do you know anything about this? our production site's on stake π¦
@void cairn Totally understand. I am actually supposed to be working right now, but let's try and take a look.
Can you send me the file in question?
the node_modules/next.js... file?
next auth doc says to configure NEXTAUTH_URL but thats already configured at my end!
So I'm thinking that due to the error message in the last screen-shot, there is something wrong with your module handling.
What I mean by that is that you are using EcmaScript Module (ESM or 'ES6 Modules') syntax but your environment does not support it (for some reason)...
weird, i didnt change anything related to this at all π¨
Can I see your tsconfig.json file, and your package.json?
And also your next.config.js file please.
https://paste.sh/UWRoLQVv#Tl85qbe1qPC2coGhz8qIOPha
package.json
Just paste it here using a code-block.
discord limited it
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@/prisma/*": ["prisma/*"],
"@/src/*": ["src/*"],
"@/components/*": ["src/components/*"],
"@/config/*": ["src/config/*"],
"@/hooks/*": ["src/hooks/*"],
"@/layouts/*": ["src/layouts/*"],
"@/lib/*": ["src/lib/*"],
"@/providers/*": ["src/providers/*"],
"@/sections/*": ["src/sections/*"],
"@/styles/*": ["src/styles/*"],
"@/utils/*": ["src/utils/*"]
},
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"strict": false,
"forceConsistentCasingInFileNames": true,
"noEmit": true,
"incremental": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve"
},
"include": [
"next-env.d.ts",
"**/*.ts",
"**/*.tsx",
"src/pages/freelancer/dashboard/index.js",
"src/components/FreelancerDashboardComponent/viewjobs/index.js",
"src/components/JobPostModal/index.jsx",
"src/providers/jobListProvider.jsx",
"src/pages/api/freelancer/referfriend.js",
"prisma/services/freelancer/referalfriend.js",
"src/components/ReferFriend/index.js",
"src/components/SearchBar/SearchResults.jsx",
"src/components/Modals/ApplyJobModal/index.jsx",
"src/components/FreelancerDashboardComponent/RecommendedJobs/index.jsx"
],
"exclude": ["node_modules"]
}
tsconfig.json
Or use github gists
module.exports = {
images: {
domains: [''],
},
compiler: {
styledComponents: true,
},
reactStrictMode: false,
};
next.config.js
Try adding "type": "module" to your package.json.
Worth a shot as I don't see it
And then can I also see your entry point for next-auth?
gives me lots of errors
So do what it says, and convert/rename postcss.config.js into postcss.config.cjs
oh boi
Well I mean now you have more errors to work with π
Well, something is probably causing an issue...
But if you want to ignore it and go back, sure.
@void cairn Try doing pnpm update (or whatever you use)
did, no luck!
anyways thanks for the help, I'll go now, almost 1 am here. will ask my senior dev to look into this issue πͺ . If you ever come across a vim related issue, ping me up.
@harsh falcon this fixed it man
#next-auth message
so it was an upstream issue after all, just removed the caret ^ from version number in package.json
β
Success!
This question has been marked as answered! If you have any other questions, feel free to create another post
Jump to answer
[Click here](#1130931384471519232 message)
Did u set env variables in vercel
Oh nvm u fixed it
your site looks pretty dope btw
π
Which ones
legions.dev
your UI design looks very beautiful too!
did you take any course or something :0
No only self learning
cool
any guides you'd suggest to a newbie?
Just watch many UIs on google and just make in brain that how u can make it in css
I daily watch many time of UIs
