DEV Community

Kunihiko Tanaka
Kunihiko Tanaka

Posted on

2 1

Tried & published Next.js 9.0 + TypeScript + redux-observable starter

Next.js 9.0 has been released.
I tried it with my usual development libs (redux-observable, styled components, etc...), and I found some gotchas, so I'm writing down this.

redux-observable

Using redux-observable with Next.js, we have to put some code to /pages/_app.ts, and the style is little bit different comparing to pure react development.
There are some libraries that helps it

import 'semantic-ui-css/semantic.min.css'

In the Next.js world, we have to create next.config.js instead of webpack.config.js .
So I wrote css-loader settings on it. But it didn't work well.
I googled & found the information about @zeit/next-css.
But next-css was displaying error like Invalid Option, so I googled more, and I found the issue of it.
It's just workaround, but worked well.
My next.config.js is following.
https://github.com/kunihiko-t/nextjs9-ts-redux-observable-starter/blob/master/next.config.js

Styled Components

There are some errors on the browser console.
I've googled again and some articles saying use .babelrc.
So I've added .babelrc and it solved the issue.

{
"presets": ["next/babel"],
"plugins": ["styled-components"]
}

Published starter

There are no errors for now.
I felt that using Next.js is little bit different from pure react development, and it made me confusing.
So I published this article & Next.js 9.0 + TypeScript + redux-observable starter for me, and the person who is trying Next.js but struggling with errors.
But this repository is still WIP.

  • [ ] Use middleware or something for Authentication
  • [ ] Set alias for import { foo } from '~/foo'
  • [ ] Remove 'any' type from epic

Qodo Takeover

Introducing Qodo Gen 1.0: Transform Your Workflow with Agentic AI

Rather than just generating snippets, our agents understand your entire project context, can make decisions, use tools, and carry out tasks autonomously.

Read full post →

Top comments (0)

Hostinger image

Get n8n VPS hosting 3x cheaper than a cloud solution

Get fast, easy, secure n8n VPS hosting from $4.99/mo at Hostinger. Automate any workflow using a pre-installed n8n application and no-code customization.

Start now

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay