The Kuma CSS in JS library assigns a class, however it does not produce any visible changes

I've implemented Kuma.js as my CSS in JS solution for Next JS 13. I'm currently working on styling a Header component called HeaderWrapper using Kuma. Below is the code snippet:

import { styled } from "@kuma-ui/core";

const HeaderWrapper = styled("header")`
    color: red;
    background-color: blue;
`;

export default function Header() {
    return (
        <HeaderWrapper>
            <h1> Welcome </h1>
        </HeaderWrapper>
    );
}

The code runs without any errors, but it doesn't apply the intended styles. Inspecting elements in Firefox Developer Edition reveals that a class name is indeed added to the header:

<header class="kuma-3224476256">
  <h1>Welcome</h1>
</header>

However, this class kuma-3224476256 has no associated properties.

Furthermore, here's my next.config.js file:

const { withKumaUI } = require("@kuma-ui/next-plugin");

/** @type {import('next').NextConfig} */
const nextConfig = {
  reactStrictMode: true,
};

module.exports = withKumaUI(nextConfig);

I have followed the instructions provided in the documentation diligently. Is there a solution to resolve this issue?

Answer №1

The issue was discovered within the next.config.js file. It was necessary to include the appDir: true; flag.

const { withKumaUI } = require("@kuma-ui/next-plugin");

/** @type {import('next').NextConfig} */
const nextConfiguration = {
  reactStrictMode: true,
  experimental: {
    appDir: true
  }
};

module.exports = withKumaUI(nextConfiguration);

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Having trouble displaying the correct data for the Title in NextJs Head? Any solutions available?

Hi there, I am currently utilizing the <Head/> Tag from an API in my NextJs project. All meta tags are functioning properly except for the title meta tag, which seems to be displaying the first H1 on the page instead. Here is the code snippet: ...

Ways to switch up the titles on UploadThing

Recently, I started working with the UploadThing library and encountered a situation where I needed to personalize some names within the code. Here is what I have so far: Below is the snippet of code that I am currently using: "use client"; imp ...

Error occurred when attempting to fetch data from a nested JSON object in React/Next.JS

Having trouble retrieving data from my API and encountering this error message. I suspect it may be related to the JSON structure. Interestingly, when using a different URL with nested arrays, it works fine. However, my current data is not cooperating. Any ...

Utilize the following imported fonts within your SCSS variables

Hey there, I've been working with Next13 and running into some issues with using the Next font variable in my SCSS files. In my app/layout.tsx file, here is how I have declared the font: const montserrat = Montserrat({ weight: ['400'], ...

Using SVG files in NextJS

I'm encountering an issue while trying to import an SVG file in a NextJS project. The error message I keep getting is: ./assets/aboutimg.svg 1:0 Module parse failed: Unexpected token (1:0) You may need an appropriate loader to handle this file type, ...

After being deployed via Vercel, MongoDB faces connectivity issues with the web

After deploying my web app on Vercel, I encountered an issue where the MongoDB connection was working fine during development but failed to connect after deployment. It was suggested before deployment to reduce the function running time from 300s to 10s du ...

What is the best way to host a Next.js App on Netlify?

I've encountered a problem with my Next.js app deployment. Following a tutorial from netlify's blog on implementing Server-side Rendering for Next.js using netlify, I managed to build the app successfully but it's not functioning as expected ...

Dealing with an issue where Next.js router is not properly handling query parameters and returning them as undefined

Within my Next.js application, I have a page that functions as a search feature. The path for this page is structured like so: /search?q=search+slug. This specific page loads data on the client side and it's crucial to access the value of router.query ...

Error in CPanel: NextJS Static Export is failing to load due to missing JS chunks, CSS, and SVG files

Recently, I have discovered that when using VSCode Live server to host static files locally, everything seems to work perfectly. This led me to believe that the issue may lie in how CPanel deals with static files. Could it be causing the 404 not found erro ...

I am unable to retrieve the complete set of data from Redis using Redis-OM and Next.js

In my application, I have a blog feature where I use Redis as the database and redis-om for managing it. The model for the blog in the app looks like this: const model_blog = new Schema(Blog,{ title : {type : "string"}, description : {t ...

Vercel - Scheduled Tasks, Running Code exclusively during Deployment

Currently in the process of setting up a cron job on Vercel to test how our tasks, currently running on Heroku, perform on this new platform. Although the Usage report shows that the cron job is being triggered, I am unable to view the actual code executi ...

What is the best way to utilize the npm classnames library within a next.js project to selectively implement styles from a css file?

Within the following HTML markup, I am dynamically applying Bootstrap classes - alert-danger or alert-primary based on the values of message.error or message.info. These are Bootstrap classes and they function correctly. <div className={classnames(`a ...

The useState set function does not seem to be reflecting changes in the variable's value

In my Next.js app, I am exploring the 'async-mqtt' library to implement MQTT protocol. While I can successfully receive MQTT messages and view them in the local terminal (not in the browser), I'm facing an issue with updating state using the ...

Collaborate on sessions across Next.js and React applications

I manage a scenario where I have a Next application utilizing Keycloak for authentication via NextAuth, and another React application also secured by Keycloak using the official keycloak libraries (keycloak-js and react-keycloak/web), both residing within ...

How can I add a Subresource Integrity Check to a Next.js project? Is it possible in Next.js 12, 13, or 14?

Implementing the experimental sri module. experimental: { sri: { algorithm: 'sha256' } }, The subresource integrity manifest files are generated, however, the integrity attribute is not injected into the build. We were anticipat ...

Is the React State reverting to its previous value even after waiting for an update with the Effect hook

My current task seems quite straightforward to me. I am working with an array of documents in Firebase Firestore and have a method for fetching data from a document with timeStamp A to another document with timeStamp B. The issue arises when the fetch fun ...

Issue with passing server components as props to client components not resolved

An error is occurring when attempting to pass a server component as props to a client component in a Next.js v14 implementation using next-auth v5. The pattern being followed is from the Next site at https://nextjs.org/docs/app/building-your-application/re ...

Tips for maintaining the 'client use' code snippet at the beginning of your Vs Code script

In my quest to utilize the NextJs app directory, I've come across a dilemma. To implement client-side components, it mandates the usage of 'use client' at the beginning of the file. However, Vs Code has a tendency to relocate this statement ...

Customize the base path for next-auth version 4

I have a new application that is using next-auth 4 to authenticate against Azure AD. Everything seems to be working well as I am able to successfully authenticate. However, when I attempt to set a custom base path http://localhost:3000/myapp for the appli ...

I'm curious about using NextJS to fetch an API with a specific router ID. Can anyone provide guidance on how to achieve this and then render the data as HTML?

Greetings! I am currently coding in NextJS and working on a user page that fetches user-specific information from an API. My goal is to extract the ID query from the URL and use it to make an API request. The API endpoint follows this structure: /Users/{i ...