Next.js Discord

Discord Forum

Problem: barrel file with turbopack

Unanswered
Asiatic Lion posted this in #help-forum
Open in Discord
Asiatic LionOP
Hi,
i have some barrel files in my app that im importing my components from. after using turbopack im getting this error:

React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: object.
⨯ [Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object.] {
digest: '2707017483'


when i import like this
import Header from '../src/components/header'

it works but importing like this wont work
import { Header, Footer, RequestInterceptors, ModalsByUrl } from '@components'

barrel file:
export { default as Header } from './header'


and then in layout.js
import { Header, Footer, RequestInterceptors, ModalsByUrl } from '@components'

and i get the error. why ?

this is my next config
https://hastebin.skyra.pw/asuxakabeq.ts

0 Replies