How can I specify child styles with next.js?

Issue I have: import styles from ‘./Editor.module.css’ … <ReactQuill theme="bubble" value={documentState.content} onChange={handleChange} modules={modules} formats={formats} onKeyDown={handleKeyDown} className={styles.quill} /> Where Editor.module.css is: .quill { height: 100%; flex-grow: 1; padding: 0; position: relative; } .quill .ql-container { position: absolute !important; } So the

Continue reading

NextJS next-auth get session always null

Issue Can’t get the session data using getSession({req}) on a api call? useSession() on a component is working fine. package versions: nextjs@12.01, next-auth@4.3.1 issue: api/lists.ts: import prisma from "../../../lib/prisma"; import { getSession } from "next-auth/react" export default async (req: NextApiRequest,

Continue reading

Next.js adding a css class to Link

Issue How does one add a css class to a Link component in Next.js? <Link className="app-subnav__link" href="/globalSettings" > Settings overview </Link> It doesn’t like the above! ES Link is throwing an error: Solution Try this: <Link href="/globalSettings"> <a className="app-subnav__link">Settings Overview</a>

Continue reading

How to serve Next.js SSG files with Express.js

Issue When doing next export, a folder called build will be generated. Currently I want to serve these static files using Express.js, here is the code: app.use(‘/’, express.static(path.join(__dirname, ‘build’))); app.get(‘*’, (req, res) => { console.log(req.path); res.sendFile(path.resolve(__dirname, ‘build’, ‘index.html’)); }); app.listen(PORT,

Continue reading

React – Material UI grid items center issue

Issue I am unable to center the elements group using material ui grid system. Issue: The margin space on the exteme right. Code: const renderProjects = projects.map(project => ( <Grid item xs={12} sm={6} m={3} lg={3} key={project.title}> <ProjectCard title={project.title} description={project.description} image={project.image}

Continue reading

Nextjs Routes are not working when deployed to Azure App Service Linux Instance

Issue I wanted to deploy a nextjs app to Azure App Service with Linux instance. I followed the instructions here: https://developinjay.com/deploying-nextjs-app-to-azure-app-service-linux-77a43353e761 The app is live here https://interviewramp.azurewebsites.net and https://interviewramp.herokuapp.com. Routes work in Heroku. So if user goes here https://interviewramp.herokuapp.com/books/interviewramp/introduction it

Continue reading