[GH-ISSUE #587] Module not found: Can't resolve 'react-hook-form' #156

Closed
opened 2026-02-26 18:45:37 +03:00 by kerem · 4 comments
Owner

Originally created by @olivierlambert on GitHub (Oct 22, 2023).
Original GitHub issue: https://github.com/documenso/documenso/issues/587

Issue Description

Can't access the application (see the screenshot below) when using npm run dev, also failing to compile when trying to npm run build:web (likely related I assume).

Steps to Reproduce

  1. Git clone the repo on the feat/refresh branch
  2. Create the .env from the example file, fill it with relevant data
  3. npm i in the root of the repo, then npm run prisma:migrate-deploy (works perfectly)
  4. Starting the app with npm run dev, connect to it and see the result in the following screenshot
  5. Optional: same error when trying to npm run build:web

Expected Behavior

See the actual app

Current Behavior

Visible result when visiting the page after a npm run dev:

image

Result of a npm run build:web:

$ npm run build:web

> build:web
> turbo run build --filter=@documenso/web

╭────────────────────────────────────────────────────────────────────────╮
│                                                                        │
│                  Update available v1.10.15 ≫ v1.10.16                  │
│    Changelog: https://github.com/vercel/turbo/releases/tag/v1.10.16    │
│               Run "npx @turbo/codemod update" to update                │
│                                                                        │
│      Follow @turborepo for updates: https://twitter.com/turborepo      │
╰────────────────────────────────────────────────────────────────────────╯
• Packages in scope: @documenso/web
• Running build in 1 packages
• Remote caching disabled
@documenso/prisma:build: cache hit (outputs already on disk), replaying logs 2a89f5b50fc16948
@documenso/prisma:build: 
@documenso/prisma:build: > @documenso/prisma@1.0.0 build
@documenso/prisma:build: > prisma generate
@documenso/prisma:build: 
@documenso/prisma:build: Prisma schema loaded from schema.prisma
@documenso/prisma:build: 
@documenso/prisma:build: ✔ Generated Prisma Client (v5.4.2) to ./../../node_modules/@prisma/client in 323ms
@documenso/prisma:build: 
@documenso/prisma:build: Start using Prisma Client in Node.js (See: https://pris.ly/d/client)
@documenso/prisma:build: ```
@documenso/prisma:build: import { PrismaClient } from '@prisma/client'
@documenso/prisma:build: const prisma = new PrismaClient()
@documenso/prisma:build: ```
@documenso/prisma:build: or start using Prisma Client at the edge (See: https://pris.ly/d/accelerate)
@documenso/prisma:build: ```
@documenso/prisma:build: import { PrismaClient } from '@prisma/client/edge'
@documenso/prisma:build: const prisma = new PrismaClient()
@documenso/prisma:build: ```
@documenso/prisma:build: 
@documenso/prisma:build: See other ways of importing Prisma Client: http://pris.ly/d/importing-client
@documenso/prisma:build: 
@documenso/web:build: cache miss, executing a56ea7f4eda3a861
@documenso/web:build: 
@documenso/web:build: > @documenso/web@0.1.0 build
@documenso/web:build: > next build
@documenso/web:build: 
@documenso/web:build:    Creating an optimized production build ...
@documenso/web:build: Warning: For production Image Optimization with Next.js, the optional 'sharp' package is strongly recommended. Run 'npm i sharp', and Next.js will use it automatically for Image Optimization.
@documenso/web:build: Read more: https://nextjs.org/docs/messages/sharp-missing-in-production
@documenso/web:build: <w> [webpack.cache.PackFileCacheStrategy] Serializing big strings (126kiB) impacts deserialization performance (consider using Buffer instead and decode when needed)
@documenso/web:build: Failed to compile.
@documenso/web:build: 
@documenso/web:build: ./src/app/(dashboard)/admin/users/[id]/page.tsx
@documenso/web:build: Module not found: Can't resolve 'react-hook-form'
@documenso/web:build: 
@documenso/web:build: https://nextjs.org/docs/messages/module-not-found
@documenso/web:build: 
@documenso/web:build: ./src/app/(dashboard)/settings/billing/billing-plans.tsx
@documenso/web:build: Module not found: Can't resolve 'framer-motion'
@documenso/web:build: 
@documenso/web:build: https://nextjs.org/docs/messages/module-not-found
@documenso/web:build: 
@documenso/web:build: ./src/app/(signing)/sign/[token]/form.tsx
@documenso/web:build: Module not found: Can't resolve 'react-hook-form'
@documenso/web:build: 
@documenso/web:build: https://nextjs.org/docs/messages/module-not-found
@documenso/web:build: 
@documenso/web:build: ./src/components/form/form-error-message.tsx
@documenso/web:build: Module not found: Can't resolve 'framer-motion'
@documenso/web:build: 
@documenso/web:build: https://nextjs.org/docs/messages/module-not-found
@documenso/web:build: 
@documenso/web:build: Import trace for requested module:
@documenso/web:build: ./src/components/forms/password.tsx
@documenso/web:build: 
@documenso/web:build: ./src/components/forms/forgot-password.tsx
@documenso/web:build: Module not found: Can't resolve 'react-hook-form'
@documenso/web:build: 
@documenso/web:build: https://nextjs.org/docs/messages/module-not-found
@documenso/web:build: 
@documenso/web:build: 
@documenso/web:build: > Build failed because of webpack errors
@documenso/web:build: npm ERR! Lifecycle script `build` failed with error: 
@documenso/web:build: npm ERR! Error: command failed 
@documenso/web:build: npm ERR!   in workspace: @documenso/web@0.1.0 
@documenso/web:build: npm ERR!   at location: /data/documenso/apps/web 
@documenso/web:build: ERROR: command finished with error: command (/data/documenso/apps/web) npm run build exited (1)
@documenso/web#build: command (/data/documenso/apps/web) npm run build exited (1)

 Tasks:    1 successful, 2 total
Cached:    1 cached, 2 total
  Time:    25.999s 
Failed:    @documenso/web#build

 ERROR  run failed: command  exited (1)

Environment

  • OS: Debian 12
  • Node: v16.16.0, npm 9.5.1
  • Browser: tried both FF/Chrome, unrelated here
  • Version: commit fd8f6da2c6

Checklist

  • I have searched the existing issues to make sure this is not a duplicate.
  • I have provided steps to reproduce the issue.
  • I have included relevant environment information.
  • I have included any relevant screenshots.
  • I understand that this is a voluntary contribution and that there is no guarantee of resolution.
Originally created by @olivierlambert on GitHub (Oct 22, 2023). Original GitHub issue: https://github.com/documenso/documenso/issues/587 ## Issue Description Can't access the application (see the screenshot below) when using `npm run dev`, also failing to compile when trying to `npm run build:web` (likely related I assume). ## Steps to Reproduce 1. Git clone the repo on the `feat/refresh` branch 2. Create the `.env` from the example file, fill it with relevant data 3. `npm i` in the root of the repo, then `npm run prisma:migrate-deploy` (works perfectly) 4. Starting the app with `npm run dev`, connect to it and see the result in the following screenshot 5. Optional: same error when trying to `npm run build:web` ## Expected Behavior See the actual app ## Current Behavior Visible result when visiting the page after a `npm run dev`: ![image](https://github.com/documenso/documenso/assets/1241401/44b54a96-89d2-4dba-9efc-0eefbf065722) Result of a `npm run build:web`: ``` $ npm run build:web > build:web > turbo run build --filter=@documenso/web ╭────────────────────────────────────────────────────────────────────────╮ │ │ │ Update available v1.10.15 ≫ v1.10.16 │ │ Changelog: https://github.com/vercel/turbo/releases/tag/v1.10.16 │ │ Run "npx @turbo/codemod update" to update │ │ │ │ Follow @turborepo for updates: https://twitter.com/turborepo │ ╰────────────────────────────────────────────────────────────────────────╯ • Packages in scope: @documenso/web • Running build in 1 packages • Remote caching disabled @documenso/prisma:build: cache hit (outputs already on disk), replaying logs 2a89f5b50fc16948 @documenso/prisma:build: @documenso/prisma:build: > @documenso/prisma@1.0.0 build @documenso/prisma:build: > prisma generate @documenso/prisma:build: @documenso/prisma:build: Prisma schema loaded from schema.prisma @documenso/prisma:build: @documenso/prisma:build: ✔ Generated Prisma Client (v5.4.2) to ./../../node_modules/@prisma/client in 323ms @documenso/prisma:build: @documenso/prisma:build: Start using Prisma Client in Node.js (See: https://pris.ly/d/client) @documenso/prisma:build: ``` @documenso/prisma:build: import { PrismaClient } from '@prisma/client' @documenso/prisma:build: const prisma = new PrismaClient() @documenso/prisma:build: ``` @documenso/prisma:build: or start using Prisma Client at the edge (See: https://pris.ly/d/accelerate) @documenso/prisma:build: ``` @documenso/prisma:build: import { PrismaClient } from '@prisma/client/edge' @documenso/prisma:build: const prisma = new PrismaClient() @documenso/prisma:build: ``` @documenso/prisma:build: @documenso/prisma:build: See other ways of importing Prisma Client: http://pris.ly/d/importing-client @documenso/prisma:build: @documenso/web:build: cache miss, executing a56ea7f4eda3a861 @documenso/web:build: @documenso/web:build: > @documenso/web@0.1.0 build @documenso/web:build: > next build @documenso/web:build: @documenso/web:build: Creating an optimized production build ... @documenso/web:build: Warning: For production Image Optimization with Next.js, the optional 'sharp' package is strongly recommended. Run 'npm i sharp', and Next.js will use it automatically for Image Optimization. @documenso/web:build: Read more: https://nextjs.org/docs/messages/sharp-missing-in-production @documenso/web:build: <w> [webpack.cache.PackFileCacheStrategy] Serializing big strings (126kiB) impacts deserialization performance (consider using Buffer instead and decode when needed) @documenso/web:build: Failed to compile. @documenso/web:build: @documenso/web:build: ./src/app/(dashboard)/admin/users/[id]/page.tsx @documenso/web:build: Module not found: Can't resolve 'react-hook-form' @documenso/web:build: @documenso/web:build: https://nextjs.org/docs/messages/module-not-found @documenso/web:build: @documenso/web:build: ./src/app/(dashboard)/settings/billing/billing-plans.tsx @documenso/web:build: Module not found: Can't resolve 'framer-motion' @documenso/web:build: @documenso/web:build: https://nextjs.org/docs/messages/module-not-found @documenso/web:build: @documenso/web:build: ./src/app/(signing)/sign/[token]/form.tsx @documenso/web:build: Module not found: Can't resolve 'react-hook-form' @documenso/web:build: @documenso/web:build: https://nextjs.org/docs/messages/module-not-found @documenso/web:build: @documenso/web:build: ./src/components/form/form-error-message.tsx @documenso/web:build: Module not found: Can't resolve 'framer-motion' @documenso/web:build: @documenso/web:build: https://nextjs.org/docs/messages/module-not-found @documenso/web:build: @documenso/web:build: Import trace for requested module: @documenso/web:build: ./src/components/forms/password.tsx @documenso/web:build: @documenso/web:build: ./src/components/forms/forgot-password.tsx @documenso/web:build: Module not found: Can't resolve 'react-hook-form' @documenso/web:build: @documenso/web:build: https://nextjs.org/docs/messages/module-not-found @documenso/web:build: @documenso/web:build: @documenso/web:build: > Build failed because of webpack errors @documenso/web:build: npm ERR! Lifecycle script `build` failed with error: @documenso/web:build: npm ERR! Error: command failed @documenso/web:build: npm ERR! in workspace: @documenso/web@0.1.0 @documenso/web:build: npm ERR! at location: /data/documenso/apps/web @documenso/web:build: ERROR: command finished with error: command (/data/documenso/apps/web) npm run build exited (1) @documenso/web#build: command (/data/documenso/apps/web) npm run build exited (1) Tasks: 1 successful, 2 total Cached: 1 cached, 2 total Time: 25.999s Failed: @documenso/web#build ERROR run failed: command exited (1) ``` ## Environment - OS: Debian 12 - Node: `v16.16.0`, npm `9.5.1` - Browser: tried both FF/Chrome, unrelated here - Version: commit fd8f6da2c68494775d0b8d2079768fd1b2c359c9 ## Checklist - [X] I have searched the existing issues to make sure this is not a duplicate. - [X] I have provided steps to reproduce the issue. - [X] I have included relevant environment information. - [X] I have included any relevant screenshots. - [X] I understand that this is a voluntary contribution and that there is no guarantee of resolution.
kerem closed this issue 2026-02-26 18:45:37 +03:00
Author
Owner

@adityadeshlahre commented on GitHub (Oct 22, 2023):

try switching node version => 18.x.x and run npm run clean && npm run d
[check discord once]

<!-- gh-comment-id:1774119221 --> @adityadeshlahre commented on GitHub (Oct 22, 2023): **try switching `node version => 18.x.x `and run `npm run clean && npm run d`** **[check discord once]**
Author
Owner

@ephraimduncan commented on GitHub (Oct 22, 2023):

Can you run this and try again?

npm run reset:hard
<!-- gh-comment-id:1774128096 --> @ephraimduncan commented on GitHub (Oct 22, 2023): Can you run this and try again? ``` npm run reset:hard ```
Author
Owner

@olivierlambert commented on GitHub (Oct 22, 2023):

npm run reset:hard seems to do the trick. I can see the page. Before closing, just wait a bit so I go a bit further to confirm it's entirely solved. Thanks!

<!-- gh-comment-id:1774190615 --> @olivierlambert commented on GitHub (Oct 22, 2023): `npm run reset:hard` seems to do the trick. I can see the page. Before closing, just wait a bit so I go a bit further to confirm it's entirely solved. Thanks!
Author
Owner

@olivierlambert commented on GitHub (Oct 22, 2023):

Okay I made it 👍 (sign a doc from start to the end).

Next step: making all of this behind a proper reverse SSL proxy and running in my VM (without using Docker).

Thanks a lot for your help!

<!-- gh-comment-id:1774192467 --> @olivierlambert commented on GitHub (Oct 22, 2023): Okay I made it :+1: (sign a doc from start to the end). Next step: making all of this behind a proper reverse SSL proxy and running in my VM (without using Docker). Thanks a lot for your help!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/documenso#156
No description provided.