Minify Issue | Nextjs Webpack | Server Only #191

Closed
opened 2026-02-15 17:17:06 -05:00 by yindo · 2 comments
Owner

Originally created by @jordanparker6 on GitHub (Mar 6, 2025).

Unable to build a NextJS app with langgraph.js without setting the following on the server only build.

If minimize=true, the build compiles and then throws TypeError: Cannot set properties of undefined (setting 'SHA224')

next.config.js

  webpack: (config, { isServer }) => {
    config.externalsPresets = { node: true }
    config.ignoreWarnings = [{ module: /opentelemetry/ }];
    config.externals = [...(config.externals || []), 'canvas', 'domino', 'danfojs-node'];

    if (!isServer) {
      config.resolve.fallback = {
        ...config.resolve.fallback,
        googleapis: false,
        'google-auth-library': false,
      };
      config.resolve.alias = {
        ...config.resolve.alias,
        '@slack/web-api': false,
      };
    } else {
      config.optimization.minimize = false;
    }

This was a related issue.
https://github.com/langchain-ai/langgraphjs/issues/180

Originally created by @jordanparker6 on GitHub (Mar 6, 2025). Unable to build a NextJS app with langgraph.js without setting the following on the server only build. If `minimize=true`, the build compiles and then throws `TypeError: Cannot set properties of undefined (setting 'SHA224')` next.config.js ``` webpack: (config, { isServer }) => { config.externalsPresets = { node: true } config.ignoreWarnings = [{ module: /opentelemetry/ }]; config.externals = [...(config.externals || []), 'canvas', 'domino', 'danfojs-node']; if (!isServer) { config.resolve.fallback = { ...config.resolve.fallback, googleapis: false, 'google-auth-library': false, }; config.resolve.alias = { ...config.resolve.alias, '@slack/web-api': false, }; } else { config.optimization.minimize = false; } ``` This was a related issue. https://github.com/langchain-ai/langgraphjs/issues/180
yindo closed this issue 2026-02-15 17:17:06 -05:00
Author
Owner

@benjamincburns commented on GitHub (Apr 28, 2025):

@jordanparker6 What version of next are you using? Is the issue still present after 15.2.2?

@benjamincburns commented on GitHub (Apr 28, 2025): @jordanparker6 What version of next are you using? Is the issue still present after 15.2.2?
Author
Owner

@dqbd commented on GitHub (Jul 7, 2025):

Hello! Cannot replicate on next@15.3.5, tested against Pages Router and App Router. Closing for now, feel free to create a new issue if the issue still persists.

@dqbd commented on GitHub (Jul 7, 2025): Hello! Cannot replicate on `next@15.3.5`, tested against Pages Router and App Router. Closing for now, feel free to create a new issue if the issue still persists.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/langgraphjs#191