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

fix: Phosphor-icons import error on pages with SSR #79

Merged
merged 9 commits into from
Mar 29, 2024

Conversation

Karmotrine
Copy link
Contributor

@Karmotrine Karmotrine commented Mar 29, 2024

Error: Error: EMFILE: too many open files

  • Shows up in runtime logs in Vercel deployment

Screenshots:
/ page:
image

/events page:
image

Affected components:

  • / (home), /events page route with SSR that has UI components using @phosphor-icons/react

Changes Include:

  • chore: update @phosphor-icons/react and NextJS + supporting dependencies to latest version
  • fix: change icon import paths to specific modules @phosphor-icons/react within UI components,
    • e.g. import { CaretDown } from '@phosphor-icons/react/dist/ssr/CaretDown';
  • changes to next.config.js:
    • add @phosphor-icons/react to modularizeImports and optimizePackageImports
  • disable all next/dynamic imports

Resources:

- add phosphor-icons library under optimizePackageImports `next.config.js` to fix SSR issue
- fix (index.tsx, events.tsx) Disable SSR for next/dynamic imported ui components
- fix: install phosphor-react icons for NextJs, change all icon import to "@phosphor-icons/react/dist/ssr" submodule
Copy link

vercel bot commented Mar 29, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
tpg-website ✅ Ready (Inspect) Visit Preview Mar 29, 2024 6:27am

@Karmotrine Karmotrine merged commit 65e43cb into dev Mar 29, 2024
2 checks passed
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

Successfully merging this pull request may close these issues.

1 participant