我有这个 nextjs 应用程序,灯塔一直告诉我删除未使用的块。
\n\n\nRun Code Online (Sandbox Code Playgroud)\n\xe2\x80\xa6chunks/26c47f1\xe2\x80\xa6.6971807\xe2\x80\xa6.js\n410.0 KiB\n399.8 KiB\n\xe2\x80\xa6chunks/25.91c4046\xe2\x80\xa6.js\n437.6 KiB\n392.5 KiB\n\xe2\x80\xa6chunks/30.3fdf525\xe2\x80\xa6.js\n
我不知道它们是如何生成的,也不知道如何删除它们。我到处都搜索过,但找不到解决方案。
\n构建后如何删除未使用的块?
\n我在 nginx 上使用 nextjs 和 nextauth。我遇到构建失败,但我不知道如何修复此错误。
2021-12-06T09:35:02.4779281Z https://nextjs.org/telemetry
2021-12-06T09:35:02.4779648Z
2021-12-06T09:35:02.7626345Z info - Checking validity of types...
2021-12-06T09:35:03.6479273Z warn - No ESLint configuration detected. Run next lint to begin setup
2021-12-06T09:35:03.6504824Z info - Creating an optimized production build...
2021-12-06T09:35:11.0167427Z Failed to compile.
2021-12-06T09:35:11.0168180Z
2021-12-06T09:35:11.0173424Z ModuleNotFoundError: Module not found: Error: Package path ./client is not exported from package /var/www/html/node_modules/next-auth (see exports field in /var/www/html/node_modules/next-auth/package.json)
2021-12-06T09:35:11.0177457Z
2021-12-06T09:35:11.0181521Z
2021-12-06T09:35:11.0184681Z > Build error occurred
2021-12-06T09:35:11.0202372Z Error: > Build failed because of webpack errors
2021-12-06T09:35:11.0203202Z at …Run Code Online (Sandbox Code Playgroud)