Coder Social home page Coder Social logo

Comments (3)

kon-pas avatar kon-pas commented on June 5, 2024 1

First, create babel.config.js in the root of your project:

// babel.config.js
module.exports = {
  presets: ['next/babel'],
  plugins: ['macros'],
}

Then remove next/font from src/app/layout.js, for example:

// src/app/layout.js
import GlobalStyles from '../styles/GlobalStyles'
import StyledComponentsRegistry from '../lib/registry'

export const metadata = {
  title: 'Create Next App',
  description: 'Generated by create next app',
}

export default function RootLayout({ children }) {
  return (
    <html lang="en">
      <body>
        <StyledComponentsRegistry>
          <GlobalStyles />
          {children}
        </StyledComponentsRegistry>
      </body>
    </html>
  )
}

The above resolved the issue for me.

For more on why we have to remove next/font, see this comment.

from twin.macro.

SanskarDahiya avatar SanskarDahiya commented on June 5, 2024

I'm also facing this issue with "next": "^13.5.6",

from twin.macro.

hexaaagon avatar hexaaagon commented on June 5, 2024

Hi @kon-pas, thanks for solution. I'm having a problem after placing your solution. this is the error:

  ./src/app/[locale]/(pages)/page.tsx:25:36
Syntax error: Unexpected token, expected ","

  23 | import ContactSection from "./contact.sect";
  24 |
> 25 | export default function Home(request: {
     |                                     ^
  26 |   params: { locale: "id" | "en" };
  27 |   searchParams: {
  28 |     changeLang?: "true" | "false";

I guess that this issue may related into my issue. When i delete the babel config, it works BUT the v8 errors come up.

from twin.macro.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.