Closed qlaffont closed 8 months ago
Failed to compile.
./src/components/common/ErrorBoundary.tsx
ReactServerComponentsError:
The "use client" directive must be placed before other expressions. Move it to the top of the file to resolve this issue.
╭─[/apps/umami/node_modules/.pnpm/react-error-boundary@4.0.4_react@18.2.0/node_modules/react-error-boundary/dist/react-error-boundary.module.js:142:1]
142 │ var $81c1b644006d48ec$exports = {};
143 │
144 │
145 │ "use client";
· ─────────────
146 │
147 │
148 │ export {$44d7e150ebc754d2$export$e926676385687eaf as ErrorBoundary, $ebb31c7feaa4405e$export$b16d9fb1a22de840 as ErrorBoundaryContext, $7c3c25b3f398a9d6$export$c052f6604b7d51fe as useErrorBoundary, $62ff477d53f02a5b$export$f0c7a449e0cfaec7 as withErrorBoundary};
╰────
The error was caused by importing 'react-error-boundary/dist/react-error-boundary.module.js' in './src/components/common/ErrorBoundary.tsx'.
Import path:
./src/components/common/ErrorBoundary.tsx
./src/app/Providers.tsx
> Build failed because of webpack errors
Creating an optimized production build . ELIFECYCLE Command failed with exit code 1.
ERROR: "build-app" exited with 1.
ELIFECYCLE Command failed with exit code 1.z
```
Have you tried using v2.9.0?
same in 2.9.0 @mikecao
Log:
node -v
v20.10.0
> umami@2.9.0 build-geo /apps/umami
> node scripts/build-geo.js
Saved geo database: /apps/umami/geo/GeoLite2-City.mmdb
> umami@2.9.0 build-app /apps/umami
> next build
▲ Next.js 14.0.4
- Environments: .env
Failed to compile.
./src/components/common/ErrorBoundary.tsx
ReactServerComponentsError:
The "use client" directive must be placed before other expressions. Move it to the top of the file to resolve this issue.
╭─[/apps/umami/node_modules/.pnpm/react-error-boundary@4.0.4_react@18.2.0/node_modules/react-error-boundary/dist/react-error-boundary.module.js:142:1]
142 │ var $81c1b644006d48ec$exports = {};
143 │
144 │
145 │ "use client";
· ─────────────
146 │
147 │
148 │ export {$44d7e150ebc754d2$export$e926676385687eaf as ErrorBoundary, $ebb31c7feaa4405e$export$b16d9fb1a22de840 as ErrorBoundaryContext, $7c3c25b3f398a9d6$export$c052f6604b7d51fe as useErrorBoundary, $62ff477d53f02a5b$export$f0c7a449e0cfaec7 as withErrorBoundary};
╰────
The error was caused by importing 'react-error-boundary/dist/react-error-boundary.module.js' in './src/components/common/ErrorBoundary.tsx'.
Import path:
./src/components/common/ErrorBoundary.tsx
./src/app/Providers.tsx
> Build failed because of webpack errors
Creating an optimized production build . ELIFECYCLE Command failed with exit code 1.
ERROR: "build-app" exited with 1.
ELIFECYCLE Command failed with exit code 1.
You're just running yarn build
? I just pulled from master and it built without issue. You can also try the dev
branch.
This is the script of what I do :
#!/bin/sh
pm2 stop ecosystem.config.js
git pull
pnpm install
pnpm run build
pm2 start ecosystem.config.js
Can you try building with yarn
?
it works ! I can confirm it doesn't work with pnpm :/
Describe the Bug
Impossible to load data
Database
PostgreSQL
Relevant log output