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

Serverless Function has timed out if adding any icon from @mui/icons-material at _app.tsx page #43957

Closed
1 task done
dev-ahmedhany opened this issue Dec 12, 2022 · 4 comments
Labels
bug Issue was opened via the bug report template.

Comments

@dev-ahmedhany
Copy link

Verify canary release

  • I verified that the issue exists in the latest Next.js canary release

Provide environment information

The bug at Vercel's server (or netlify) not at localhost

Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 22.1.0: Sun Oct 9 20:14:30 PDT 2022; root:xnu-8792.41.9~2/RELEASE_ARM64_T8103
Binaries:
Node: 16.18.0
npm: 8.15.0
Yarn: 1.22.19
pnpm: N/A
Relevant packages:
next: 13.0.6
eslint-config-next: 13.0.6
react: 18.2.0
react-dom: 18.2.0

Which area(s) of Next.js are affected? (leave empty if unsure)

Middleware / Edge (API routes, runtime)

Link to the code that reproduces this issue

https://github.com/dev-ahmedhany/nextjs-mui-bug

To Reproduce

any icon from @mui/icons-material at _app.tsx page

Describe the Bug

getting error Serverless Function has timed out at any serverless function if added any icon from @mui/icons-material at _app.tsx page

Expected Behavior

running the serverless function

Which browser are you using? (if relevant)

No response

How are you deploying your application? (if relevant)

vercel, netlify

@dev-ahmedhany dev-ahmedhany added the bug Issue was opened via the bug report template. label Dec 12, 2022
@smaeda-ks
Copy link
Member

@balazsorban44
Copy link
Member

@dev-ahmedhany
Copy link
Author

@balazsorban44

modularize-imports worked the best

this general version didn't work

// next.config.js
module.exports = {
  experimental: {
    modularizeImports: {
      'my-library/?(((\\w*)?/?)*)': {
        transform: 'my-library/{{ matches.[1] }}/{{member}}',
      },
    },
  },
}

i had to write this

const nextConfig = {
  reactStrictMode: true,
  experimental: {
    modularizeImports: {
      "@mui/material": {
        transform: "@mui/material/{{member}}",
      },
      "@mui/icons-material": {
        transform: "@mui/icons-material/{{member}}",
      },
    },
  },
};

minimizing-bundle-size falling back to babel it fixes the bug but slow at build at Vercel servers

Is there any relation between serverless function and _app file that I can make benefit from?

@github-actions
Copy link
Contributor

This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue was opened via the bug report template.
Projects
None yet
Development

No branches or pull requests

3 participants