nishiki-tech / nishiki-frontend

Nishiki is an app for tracking and sharing food inventories within groups for better pantry management.
https://nishiki.tech
MIT License
21 stars 5 forks source link

Build Error: Cannot get final name for export 'fromUtf8' of ./node_modules/@smithy/util-utf8/dist-es/index.js #185

Closed kotaaaa closed 9 months ago

kotaaaa commented 9 months ago

Description

This build error occurs when you want to use next/header from a server component that uses a client component in one of its parent components.

In the case that there is a client component in one of its parent components, if caller of api client function is server component, It worked fine with dev environment (npm run dev). However, build(npm run build) error happened.

According to my understanding, if we use even one client component in one of its parent components, we cannot use cookie function from next/header.

./node_modules/@aws-crypto/sha256-js/build/module/index.js + 12 modules
Cannot get final name for export 'fromUtf8' of ./node_modules/@smithy/util-utf8/dist-es/index.js

So, I am going to make a separate ApiClient for both Client Component and Server Component.

Criteria

Notes

Similar problem

nick-y-ito commented 9 months ago

@kotaaaa Thank you for creating the issue! You could utilize the "Problem" issue template to report a bug or any existing problem.