Skip to content

Investigate client side import issue in Next.js app #160

@SavouryGin

Description

@SavouryGin

Description

When importing chop-logic-components directly into Next.js server component (like pages in app router folder), we got a 'use-client' missing error:

Image

To avoid that we can re-export chop-logic-components in next lib folder like so:

"use client";

export * from "chop-logic-components";

And the import components inside next app from the lib:

import { Button, Header, IconName } from "@/lib/chop-logic-components";

We need to investigate how to make the direct import to server side components possible without re-exporting. If it's possible, we need to modify the library to support server side apps directly.

Additional Context

StackOverflow thread

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    ComponentsRelated to Chop Logic Components librarySpikeInvestigation task

    Type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions