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

Build error - Cannot get final name for export 'defaultParsers' #59344

Closed
1 task done
samasri opened this issue Dec 6, 2023 · 5 comments
Closed
1 task done

Build error - Cannot get final name for export 'defaultParsers' #59344

samasri opened this issue Dec 6, 2023 · 5 comments
Assignees
Labels
bug Issue was opened via the bug report template. linear: next Confirmed issue that is tracked by the Next.js team. locked

Comments

@samasri
Copy link

samasri commented Dec 6, 2023

Link to the code that reproduces this issue

CodeSandBox

To Reproduce

  1. Run yarn next build in the codesandbox terminal
  2. The error appears in the terminal while compiling

Current vs. Expected behavior

Current

Failed to compile.

./backend/package/index.ts + 8 modules
Cannot get final name for export 'defaultParsers' of ./node_modules/@ucast/mongo/dist/es6m/index.mjs


> Build failed because of webpack errors
error Command failed with exit code 1.

Expected

I expect the app to build successfully

Verify canary release

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

Provide environment information

Operating System:
  Platform: linux
  Arch: x64
  Version: #1 SMP PREEMPT_DYNAMIC Sun Aug  6 20:05:33 UTC 2023
Binaries:
  Node: 20.9.0
  npm: 9.8.1
  Yarn: 1.22.19
  pnpm: 8.10.2
Relevant Packages:
  next: 14.0.4-canary.42
  eslint-config-next: 13.4.19
  react: 18.2.0
  react-dom: 18.2.0
  typescript: 5.1.6
Next.js Config:
  output: N/A

Which area(s) are affected? (Select all that apply)

Not sure

Additional context

Similar issue has been reported earlier and marked as resolved

NEXT-1820

@samasri samasri added the bug Issue was opened via the bug report template. label Dec 6, 2023
@rafalzawadzki
Copy link

rafalzawadzki commented Dec 7, 2023

Same here:

> next build

   ▲ Next.js 14.0.4-canary.47
   - Environments: .env

Failed to compile.

./node_modules/.pnpm/posthog-node@3.1.3/node_modules/posthog-node/lib/index.esm.js + 49 modules
Cannot get final name for export 'default.request' of ./node_modules/.pnpm/axios@1.6.2/node_modules/axios/index.js

> Build failed because of webpack errors
   Creating an optimized production build  . ELIFECYCLE  Command failed with exit code 1.`

In my case upgrading to posthog-node@3.2.0 seems to have solved the issue.

@huozhi huozhi added the linear: next Confirmed issue that is tracked by the Next.js team. label Dec 7, 2023
@huozhi huozhi self-assigned this Dec 7, 2023
@huozhi
Copy link
Member

huozhi commented Dec 7, 2023

Hi it's not fully working with default config, but there's a workaround: after the fix we landed in #59369, you need to also add the packages you're using in serverComponentsExternalPackages in next.config.js.

experimental: {
    serverComponentsExternalPackages: [
      '@casl/ability',
      '@casl/prisma',
    ]
  }

And install nex@14.0.4-canary.48. It will work. I suspect there're some other overlap in the dependencies that didn't work well with resolving. I'll investigate separately. The above change could unblock you for now

@samasri
Copy link
Author

samasri commented Dec 7, 2023

Thank you Jiachi, appreciated!

@huozhi
Copy link
Member

huozhi commented Jan 4, 2024

I think the above solution will be the final, as @prisma/client is not able to be bundled, and @cals/prisma is dependent on it.

@huozhi huozhi closed this as completed Jan 4, 2024
Copy link
Contributor

This closed issue has been automatically locked because it had no new activity for 2 weeks. 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 18, 2024
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. linear: next Confirmed issue that is tracked by the Next.js team. locked
Projects
None yet
Development

No branches or pull requests

3 participants