Next.js Discord

Discord Forum

Cannot import components from another package

Unanswered
Purple Martin posted this in #help-forum
Open in Discord
Purple MartinOP
Hi all ! I'm getting crazy over what I suppose is a simple mistake.

I'm working on a design system. It exports the simplest of components

  import React from "react";

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

I then use rollup to bundle this.

Now, I'd like to use this component in a next.js 13 app. So I adapted my package.json to add the path to my local package, ran npm i -S, and tried to import my component, but it raises the following error: Unhandled Runtime Error Error: Unsupported Server Component type: undefined

I made sure that the path was correct, and that the bundled package exported my component, but still, when logging the value of my component, it always returns undefined.

Did I miss something ?

0 Replies