mirror of
https://github.com/hoppscotch/hoppscotch.git
synced 2026-04-26 09:16:03 +03:00
[GH-ISSUE #3373] [bug]: pnpm install failed with Module '"@prisma/client"' has no exported member XXX #1128
Labels
No labels
CodeDay
a11y
browser limited
bug
bug fix
cli
core
critical
design
desktop
discussion
docker
documentation
duplicate
enterprise
feature
feature
fosshack
future
good first issue
hacktoberfest
help wanted
i18n
invalid
major
minor
need information
need testing
not applicable to hoppscotch
not reproducible
pull-request
question
refactor
resolved
sandbox
self-host
spam
stale
testmu
wip
wont fix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/hoppscotch#1128
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @liudonghua123 on GitHub (Sep 19, 2023).
Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/3373
Is there an existing issue for this?
Current behavior
I tried to execute
pnpm installon windows. But some errors occured!Steps to reproduce
Environment
Production
Version
Local
@liudonghua123 commented on GitHub (Sep 19, 2023):
I also tried remove
packages\hoppscotch-backend\distandnode_modules, but it's the same.@balub commented on GitHub (Sep 21, 2023):
@liudonghua123 this is a known issue with Windows platform, we currently have a temporary fix. Could you replace the import
import { User } from '@prisma/client';toimport type { User } from '@prisma/client';in theAuthUser.tsfile in thehoppscotch-backendpackage.@liudonghua123 commented on GitHub (Sep 21, 2023):
@balub Thanks, is it a common or general issue related to typescript or just prisma? Is there any existed issue about this problem?
The temporary fix needs to change a lot of code.
I tried to replace the
import import { User } from '@prisma/client';toimport type { User } from '@prisma/client';, but the same errors still shown.@liudonghua123 commented on GitHub (Sep 21, 2023):
After some search, I found some help links, https://github.com/prisma/prisma/issues/13672#issuecomment-1476755201, https://github.com/prisma/prisma/issues/13946#issuecomment-1557768781, https://github.com/orgs/pnpm/discussions/4331, https://pnpm.io/next/npmrc#node-linker, https://nodejs.org/api/cli.html#node_preserve_symlinks1.
So maybe pnpm in monorepo project on windows with some default configuration like
preserveSymlinks : trueis problematic.Need to disable
preserveSymlinksand hoistprisma.@liudonghua123 commented on GitHub (Sep 24, 2023):
I tried run pnpm with
--preserve-symlinks, but I got some other errors.Details
``` D:\code\rust\hoppscotch-app\hoppscotch>set NODE_OPTIONS="--preserve-symlinks"D:\code\rust\hoppscotch-app\hoppscotch>rm -rf node_modules\ && pnpm install
Scope: all 11 workspace projects
Lockfile is up to date, resolution step is skipped
Packages: +2591
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Progress: resolved 2591, reused 2536, downloaded 0, added 2299, done
dependencies:
devDependencies:
packages/dioc prepare$ pnpm run build
│ > dioc@0.1.0 build D:\code\rust\hoppscotch-app\hoppscotch\packages\dioc
│ > vite build && tsc --emitDeclarationOnly
└─ Running...
packages/codemirror-lang-graphql prepare$ rollup -c
└─ Running...
packages/hoppscotch-data prepare$ pnpm run build:code && pnpm run build:decl
│ > @hoppscotch/data@0.4.4 build:code D:\code\rust\hoppscotch-app\hoppscotch\packages\hoppscotch-data
│ > vite build
│ ✘ [ERROR] Cannot start service: Host version "0.15.15" does not match binary version "0.14.48"
│ 1 error
[1 lines collapsed]
│ error during build:
│ Error: The service was stopped
│ at D:\code\rust\hoppscotch-app\hoppscotch\node_modules.pnpm\vite@3.2.4_@types+node@17.0.45_sass@1.53.0_terser@5.19.2\n…
│ at responseCallbacks. (D:\code\rust\hoppscotch-app\hoppscotch\node_modules.pnpm\vite@3.2.4_@types+node@17.0.…
│3 at Socket.afterClose (D:\code\rust\hoppscotch-app\hoppscotch\node_modules.pnpm\vite@3.2.4_@types+node@17.0.45_sass@1.5…
│ 1 error
│ failed to load config from D:\code\rust\hoppscotch-app\hoppscotch\packages\hoppscotch-data\vite.config.ts
│ error during build:
│ Error: The service was stopped
│ at D:\code\rust\hoppscotch-app\hoppscotch\node_modules.pnpm\vite@3.2.4_@types+node@17.0.45_sass@1.53.0_terser@5.19.2\n…
│ at responseCallbacks. (D:\code\rust\hoppscotch-app\hoppscotch\node_modules.pnpm\vite@3.2.4_@types+node@17.0.…
│ vite v4.0.4 building for production...\hoppscotch-app\hoppscotch\node_modules.pnpm\vite@3.2.4_@types+node@17.0.45_sass@1.5…
└─ Running...
packages/codemirror-lang-graphql prepare$ rollup -ch-app\hoppscotch\packages\hoppscotch-ui\vite.config.ts
└─ Running...
packages/hoppscotch-data prepare$ pnpm run build:code && pnpm run build:decl4_@types+node@17.0.45_sass@1.53.0_terser@5.19.2\n…
[4 lines collapsed]
│ failed to load config from D:\code\rust\hoppscotch-app\hoppscotch\packages\hoppscotch-data\vite.config.ts_@types+node@17.0.…
│ error during build:
│ Error: The service was stopped
│ at D:\code\rust\hoppscotch-app\hoppscotch\node_modules.pnpm\vite@3.2.4_@types+node@17.0.45_sass@1.53.0_terser@5.19.2\n…
│ at responseCallbacks. (D:\code\rust\hoppscotch-app\hoppscotch\node_modules.pnpm\vite@3.2.4_@types+node@17.0.…
│ at Socket.afterClose (D:\code\rust\hoppscotch-app\hoppscotch\node_modules.pnpm\vite@3.2.4_@types+node@17.0.45_sass@1.5…
│ at Socket.emit (node:events:523:35)
│ at endReadableNT (node:internal/streams/readable:1367:12)
│ at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
│ ELIFECYCLE Command failed with exit code 1.
└─ Running...
│ transforming...ch-ui postinstall$ pnpm run build
└─ Running...
packages/codemirror-lang-graphql prepare$ rollup -ch-app\hoppscotch\packages\hoppscotch-ui\vite.config.ts
└─ Running...
packages/hoppscotch-data prepare$ pnpm run build:code && pnpm run build:decl
[4 lines collapsed]
│ failed to load config from D:\code\rust\hoppscotch-app\hoppscotch\packages\hoppscotch-data\vite.config.ts_@types+node@17.0.…
│ error during build:
│ Error: The service was stopped
│ at D:\code\rust\hoppscotch-app\hoppscotch\node_modules.pnpm\vite@3.2.4_@types+node@17.0.45_sass@1.53.0_terser@5.19.2\n…
│ at responseCallbacks. (D:\code\rust\hoppscotch-app\hoppscotch\node_modules.pnpm\vite@3.2.4_@types+node@17.0.…
│ at Socket.afterClose (D:\code\rust\hoppscotch-app\hoppscotch\node_modules.pnpm\vite@3.2.4_@types+node@17.0.45_sass@1.5…
│ at Socket.emit (node:events:523:35)
│ at endReadableNT (node:internal/streams/readable:1367:12)
│ at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
│ ELIFECYCLE Command failed with exit code 1.
└─ Running...
│ > @hoppscotch/data@0.4.4 build:code D:\code\rust\hoppscotch-app\hoppscotch\packages\hoppscotch-data
│ > vite build
│ ✘ [ERROR] Cannot start service: Host version "0.15.15" does not match binary version "0.14.48"config.ts
│ 1 error
│ failed to load config from D:\code\rust\hoppscotch-app\hoppscotch\packages\hoppscotch-data\vite.config.ts
│ error during build:
│ Error: The service was stopped
│ at D:\code\rust\hoppscotch-app\hoppscotch\node_modules.pnpm\vite@3.2.4_@types+node@17.0.45_sass@1.53.0_terser@5.19.2\n…
│ at responseCallbacks. (D:\code\rust\hoppscotch-app\hoppscotch\node_modules.pnpm\vite@3.2.4_@types+node@17.0.…
│ at Socket.afterClose (D:\code\rust\hoppscotch-app\hoppscotch\node_modules.pnpm\vite@3.2.4_@types+node@17.0.45_sass@1.5…
│ at Socket.emit (node:events:523:35)
│ at endReadableNT (node:internal/streams/readable:1367:12)
│ at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
│ ELIFECYCLE Command failed with exit code 1. generate && pnpm run generate-gql-sdl
└─ Failed in 9.8s at D:\code\rust\hoppscotch-app\hoppscotch\packages\hoppscotch-data
packages/hoppscotch-ui postinstall$ pnpm run build
│ > @hoppscotch/ui@0.0.1 build D:\code\rust\hoppscotch-app\hoppscotch\packages\hoppscotch-ui
│ > vite build
│ ✘ [ERROR] Cannot start service: Host version "0.15.15" does not match binary version "0.14.48"
│ 1 error
│ failed to load config from D:\code\rust\hoppscotch-app\hoppscotch\packages\hoppscotch-ui\vite.config.ts
│ error during build:
│ Error: The service was stopped
│ at D:\code\rust\hoppscotch-app\hoppscotch\node_modules.pnpm\vite@3.2.4_@types+node@17.0.45_sass@1.53.0_terser@5.19.2\n…
│ at responseCallbacks. (D:\code\rust\hoppscotch-app\hoppscotch\node_modules.pnpm\vite@3.2.4_@types+node@17.0.…
│ at responseCallbacks. (D:\code\rust\hoppscotch-app\hoppscotch\node_modules.pnpm\vite@3.2.4_@types+node@17.0.…
│ at Socket.afterClose (D:\code\rust\hoppscotch-app\hoppscotch\node_modules.pnpm\vite@3.2.4_@types+node@17.0.45_sass@1.5…
│ at Socket.emit (node:events:523:35)
│ at endReadableNT (node:internal/streams/readable:1367:12)
│ at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
│ ELIFECYCLE Command failed with exit code 1.
└─ Failed in 9.8s at D:\code\rust\hoppscotch-app\hoppscotch\packages\hoppscotch-ui
packages/hoppscotch-backend postinstall$ prisma generate && pnpm run generate-gql-sdl
└─ Running...
ELIFECYCLE Command failed with exit code 1.
. prepare$ husky install
└─ Running...
D:\code\rust\hoppscotch-app\hoppscotch>
@liudonghua123 commented on GitHub (Sep 26, 2023):
I tried the following hacks to fix
Cannot start service: Host version "0.15.15" does not match binary version "0.14.48". But when I executepnpm install, the links was reset and the same errors occured.@liudonghua123 commented on GitHub (Sep 26, 2023):
After I add
"esbuild": "0.15.15"topackage.jsonof root dir, I gotTypeError: Class extends value undefined is not a constructor or null.It seems it related to https://github.com/vitejs/vite/issues/9703, https://github.com/vu3th/vue-dapp/issues/20#issuecomment-973698464. And I added the following
commonjsOptionsconfiguration invite.config.tsof packages/hoppscotch-ui, packages/hoppscotch-data. But the errors still shown.@cherking commented on GitHub (Nov 22, 2023):
same problem.have you solved it
@fdj0429 commented on GitHub (Feb 28, 2024):
First
cd packages/hoppscotch-backendand do arm -rf dist && pnpm prisma generate && pnpm install, then go to top level folder and re-runpnpm installworks for me@sgch1982 commented on GitHub (Mar 22, 2024):
same problem in windows
@cherking commented on GitHub (May 7, 2024):
dosen't work
@gxy5202 commented on GitHub (Jul 11, 2024):
same issue here on Win11... I move hoppscoth to Windows WLS then I use vscode to connect it. This works for me.
@artu-ole commented on GitHub (Jul 31, 2024):
had the same issue, hoisting dependencies worked for me
pnpm install --shamefully-hoist@4innocent commented on GitHub (Aug 8, 2024):
@artu-ole awesome! works for me.
@XiEdAotonG commented on GitHub (Sep 2, 2024):
@artu-ole 老铁牛逼
@chenlei8910 commented on GitHub (Oct 11, 2024):
@artu-ole thanks
@nuxtjs/dotenv#3085