I finally found that the issue was caused by the Vite configuration. Refer to the documentation: https://vitejs.dev/config/ssr-options.html#ssr-noexternal. I added the following configuration in Vite, and the error no longer occurs.
ssr: {
noExternal: ["@atlaskit/*", "@popperjs/core"]
},
Thank you for your response!