Next.js 13 with app folder
See original GitHub issueI’m trying new app
folder which is in beta now since Next.js 13.
But using the app
folder, I have an error message that I don’t have in pages
folder.
I have pushed a minimal repos for testing purpose: https://github.com/srod/nextjs-13-tremor
git clone https://github.com/srod/nextjs-13-tremor.git
cd nextjs-13-tremor
npm install && npm run dev
Access example page: http://localhost:3000/example
error - (sc_server)/node_modules/@tremor/react/dist/cjs/index.js (6:41848) @ eval
error - TypeError: Super expression must either be null or a function
at eval (webpack-internal:///(sc_server)/./node_modules/@tremor/react/dist/cjs/index.js:1884:57)
at eval (webpack-internal:///(sc_server)/./node_modules/@tremor/react/dist/cjs/index.js:1892:6)
at eval (webpack-internal:///(sc_server)/./node_modules/@tremor/react/dist/cjs/index.js:1952:2)
at Object.(sc_server)/./node_modules/@tremor/react/dist/cjs/index.js (/Users/rodolphe/Downloads/nextjs-13-tremor/.next/server/app/example/page.js:251:1)
at __webpack_require__ (/Users/rodolphe/Downloads/nextjs-13-tremor/.next/server/webpack-runtime.js:33:42)
at eval (webpack-internal:///(sc_server)/./app/example/page.tsx:6:71)
at Object.(sc_server)/./app/example/page.tsx (/Users/rodolphe/Downloads/nextjs-13-tremor/.next/server/app/example/page.js:229:1)
at __webpack_require__ (/Users/rodolphe/Downloads/nextjs-13-tremor/.next/server/webpack-runtime.js:33:42)
at Object.page (webpack-internal:///(sc_server)/./node_modules/next/dist/build/webpack/loaders/next-app-loader.js?name=app%2Fexample%2Fpage&appPaths=%2Fexample%2Fpage&pagePath=private-next-app-dir%2Fexample%2Fpage.tsx&appDir=%2FUsers%2Frodolphe%2FDownloads%2Fnextjs-13-tremor%2Fapp&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js&rootDir=%2FUsers%2Frodolphe%2FDownloads%2Fnextjs-13-tremor&isDev=true&tsconfigPath=tsconfig.json!:22:124)
at collectGenerateParams (/Users/rodolphe/Downloads/nextjs-13-tremor/node_modules/next/dist/build/utils.js:710:194) {
type: 'TypeError',
page: '/example'
}
null
Issue Analytics
- State:
- Created a year ago
- Reactions:3
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Next.js 13: Working with the new app directory
Explore the new features introduced in the Next.js 13 app directory, which provide much more flexibility to configure our UI.
Read more >App Directory Roadmap
Section Feature Supported
React 18 Server Components ✓ Default
React 18 Client Components ✓ Opt‑in
React 18 Shared Components 🏗️
Read more >How the App Directory Works in Next.js 13
The new app directory is definitely an improvement from the previous pages directory. It includes special files like layout, head, template, ...
Read more >Next.js 13 App Playground
Explore the new app directory in Next.js 13. ... While you don't need to use the app/ directory when upgrading to Next.js 13,...
Read more >[Feedback] App Directory in Next.js 13 · Discussion #41745
Next.js 13 introduces the app directory (beta) with new features and conventions. However, upgrading to Next.js 13 does not require using the app...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
hi @srod,
When using components that are interactivity, in Next 13, I would suggest creating another file (a wrapper of the component that you want to display), which will be rendered only on the client. The default behavior of Next 13 is server-first, relying on RSC.
Adding
"use client"
at the top ofpage.tsx
will make the entire page be client rendered.How to make it work
Let’s say you want to add an
Area Chart
to any of your pages.Let’s create a component called
AreaChartComponent.tsx
(this is only a wrapper, where we specify that it needs to be client rendered).Now, in your
app/example/page.tsx
, let’s remove the"use client"
, and just import our wrapper component.@mitrotasios About the error message:
The issue might be related to circular dependencies from
d3-interpolate
+ incorrect usage of client components.Additionally, I think that the labels could be removed.