Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Next.js - Generating static page fails #129

Open
ha1fstack opened this issue Jun 21, 2023 · 2 comments
Open

Next.js - Generating static page fails #129

ha1fstack opened this issue Jun 21, 2023 · 2 comments

Comments

@ha1fstack
Copy link

ha1fstack commented Jun 21, 2023

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[O] Bug report  
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[ ] Other... Please describe:

Current behavior

When using Next.js latest with App Router,
the build fails if the page containing chart is static generated:

- info Collecting page data
- info Generating static pages (0/4)TypeError: react_cool_dimensions_dist is not a function

Expected behavior

The static page should be generated without error

Minimal reproduction of the problem with instructions

Create new next project with create-next-app, using app router.

// page.tsx
import { Chart } from "./Chart";

// if the page is not pre generated, it builds fine
// export const dynamic = "force-dynamic";

export default function Home() {
  return (
    <Chart />
  );
}
// Chart.tsx
"use client";

import { AreaChart } from "reaviz";

export const Chart = () => {
  return <AreaChart />;
};
npm run dev
-> works fine
npm run build
-> - info Generating static pages (0/4)TypeError: react_cool_dimensions_dist is not a function
-> when ssg is turned off it builds and runs fine (export const dynamic = "force-dynamic";)

What is the motivation / use case for changing the behavior?

Environment

Libs:
- react version: latest
- reaviz version: latest
 
For Tooling issues:
- Node version: 18
- Platform:  Windows 11
- Tested with both pnpm and npm
@amcdnl
Copy link
Member

amcdnl commented Jun 21, 2023

Can you provide an example repo? I'm not super familiar with Next

@ha1fstack
Copy link
Author

repo:
https://github.com/plrs9816/reaviz-next-reproduce

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants