prisma-examples icon indicating copy to clipboard operation
prisma-examples copied to clipboard

Many problem in prisma-examples/accelerate/svelte-starter/

Open 2u841r opened this issue 11 months ago β€’ 9 comments

TLDR:

  1. Problem when install - You have to manually fetch $ node_modules/openflights-cached/bin/fetch.js
  2. In migration / seed - you may have to add binaryTargets = ["native", "rhel-openssl-1.0.x"] in prisma/schema.schema
  3. Some of NPM, PNPM, Yarn and some code editor- VSCode / Cursor may behave differently.

after cloning prisma-examples/accelerate/svelte-starter/ I did pnpm i Zubair@DESKTOP-V22N2L0 MINGW64 ~/Desktop/lasttry $ pnpm i

Packages: +184
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Progress: resolved 250, reused 183, downloaded 1, added 184, done
node_modules/.pnpm/[email protected]/node_modules/openflights-cached: Running postinstall script.node_modules/.pnpm/[email protected]/node_modules/openflights-cached: Running postinstall script, failed in 25msnpm/@[email protected]/node_modules/@prisma/engines: Running postinstall script...
.../node_modules/openflights-cached postinstall$ bin/fetch.js
β”‚ 'bin' is not recognized as an internal or external command,
β”‚ operable program or batch file.
└─ Failed in 25ms at C:\Users\Zubair\Desktop\lasttry\node_modules\.pnpm\[email protected]\node_modules\openflights-cached
node_modules/.pnpm/@[email protected]/node_modules/@prisma/engines: Running postinstall script...    
 ELIFECYCLE  Command failed with exit code 1.

then I deleted node_modules and npm i

Zubair@DESKTOP-V22N2L0 MINGW64 ~/Desktop/lasttry $ npm i

npm warn cleanup Failed to remove some directories [
npm warn cleanup   [
npm warn cleanup     '\\\\?\\C:\\Users\\Zubair\\Desktop\\lasttry\\node_modules\\esbuild',
npm warn cleanup     [Error: EBUSY: resource busy or locked, rmdir 'C:\Users\Zubair\Desktop\lasttry\node_modules\esbuild'] {
npm warn cleanup       errno: -4082,
npm warn cleanup       code: 'EBUSY',
npm warn cleanup       syscall: 'rmdir',
npm warn cleanup       path: 'C:\\Users\\Zubair\\Desktop\\lasttry\\node_modules\\esbuild'
npm warn cleanup     }
npm warn cleanup   ],
npm warn cleanup   [
npm warn cleanup     'C:\\Users\\Zubair\\Desktop\\lasttry\\node_modules\\esbuild',
npm warn cleanup     [Error: EBUSY: resource busy or locked, rmdir 'C:\Users\Zubair\Desktop\lasttry\node_modules\esbuild'] {
npm warn cleanup       errno: -4082,
npm warn cleanup       code: 'EBUSY',
npm warn cleanup       syscall: 'rmdir',
npm warn cleanup       path: 'C:\\Users\\Zubair\\Desktop\\lasttry\\node_modules\\esbuild'
npm warn cleanup     }
npm warn cleanup   ],
npm warn cleanup   [
npm warn cleanup     '\\\\?\\C:\\Users\\Zubair\\Desktop\\lasttry\\node_modules\\vite',
npm warn cleanup     [Error: EBUSY: resource busy or locked, rmdir 'C:\Users\Zubair\Desktop\lasttry\node_modules\vite\node_modules\esbuild'] {
npm warn cleanup       errno: -4082,
npm warn cleanup       code: 'EBUSY',
npm warn cleanup       syscall: 'rmdir',
npm warn cleanup       path: 'C:\\Users\\Zubair\\Desktop\\lasttry\\node_modules\\vite\\node_modules\\esbuild'
npm warn cleanup     }
npm warn cleanup   ],
npm warn cleanup   [
npm warn cleanup     'C:\\Users\\Zubair\\Desktop\\lasttry\\node_modules\\vite',
npm warn cleanup     [Error: EBUSY: resource busy or locked, rmdir 'C:\Users\Zubair\Desktop\lasttry\node_modules\vite\node_modules\esbuild'] {
npm warn cleanup       errno: -4082,
npm warn cleanup       code: 'EBUSY',
npm warn cleanup       syscall: 'rmdir',
npm warn cleanup       path: 'C:\\Users\\Zubair\\Desktop\\lasttry\\node_modules\\vite\\node_modules\\esbuild'
npm warn cleanup     }
npm warn cleanup   ],
npm warn cleanup   [
npm warn cleanup     '\\\\?\\C:\\Users\\Zubair\\Desktop\\lasttry\\node_modules\\svelte',
npm warn cleanup     [Error: EPERM: operation not permitted, rmdir 'C:\Users\Zubair\Desktop\lasttry\node_modules\svelte\src\internal'] {
npm warn cleanup       errno: -4048,
npm warn cleanup       code: 'EPERM',
npm warn cleanup       syscall: 'rmdir',
npm warn cleanup       path: 'C:\\Users\\Zubair\\Desktop\\lasttry\\node_modules\\svelte\\src\\internal'  
npm warn cleanup     }
npm warn cleanup   ]
npm warn cleanup ]
npm error code 1
npm error path C:\Users\Zubair\Desktop\lasttry\node_modules\openflights-cached
npm error command failed
npm error command C:\WINDOWS\system32\cmd.exe /d /s /c bin/fetch.js
npm error 'bin' is not recognized as an internal or external command,
npm error operable program or batch file.
npm error A complete log of this run can be found in: C:\Users\Zubair\AppData\Local\npm-cache\_logs\2025-01-20T07_53_57_474Z-debug-0.log

then yarn install then i have to custom fetch $ node node_modules/openflights-cached/bin/fetch.js

in my vscode, this is the way. (before creating the issue). but in cursor (yesterday), suddenly a pop up "cursor wants to open a file", I clicked on yes, then that fetch.js opened. then I see that files path and fetch.

then In a precess- I forgot / note not taken - I got some error, (which I don't faced last time), that solved after adding following line on prisma/schema.schema generator binaryTargets = ["native", "rhel-openssl-1.0.x"]

generator client { provider = "prisma-client-js" binaryTargets = ["native", "rhel-openssl-1.0.x"] }

2u841r avatar Jan 20 '25 08:01 2u841r

Hi there, could you please try installing the example using our try-prisma CLI and let me know if things are still broken?

npx try-prisma@latest --template accelerate/svelte-starter

jharrell avatar Feb 21 '25 16:02 jharrell

Hi there, could you please try installing the example using our try-prisma CLI and let me know if things are still broken?

npx try-prisma@latest --template accelerate/svelte-starter

Zubair@DESKTOP-V22N2L0 MINGW64 ~/Desktop/Test/try-prisma-gh
$ pnpm run dev

> [email protected] dev C:\Users\Zubair\Desktop\Test\try-prisma-gh
> vite dev


  VITE v6.1.1  ready in 861 ms

  ➜  Local:   http://localhost:5173/
  ➜  Network: use --host to expose
  ➜  press h + enter to show help
X [ERROR] Could not resolve require("./dist/icaos/**/*/**/*.json")

    node_modules/.pnpm/[email protected]/node_modules/openflights-cached/index.js:10:63:
      10 β”‚ const requireicao = (id) => self.icaos.includes(id) && require(`./dist/icaos/${id.substr(0,1)}/${id}.json`);  
         β•΅                                                                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~    

X [ERROR] Could not resolve "./dist/iata2icao.json"

    node_modules/.pnpm/[email protected]/node_modules/openflights-cached/iata2icao.js:1:25:
      1 β”‚ module.exports = require("./dist/iata2icao.json");
        β•΅                          ~~~~~~~~~~~~~~~~~~~~~~~

X [ERROR] Could not resolve "./dist/iata.json"

    node_modules/.pnpm/[email protected]/node_modules/openflights-cached/iata.js:1:25:
      1 β”‚ module.exports = require("./dist/iata.json");
        β•΅                          ~~~~~~~~~~~~~~~~~~

X [ERROR] Could not resolve "./dist/array.json"

    node_modules/.pnpm/[email protected]/node_modules/openflights-cached/array.js:1:25:
      1 β”‚ module.exports = require("./dist/array.json");
        β•΅                          ~~~~~~~~~~~~~~~~~~~

X [ERROR] Could not resolve "./dist/icaos.json"

    node_modules/.pnpm/[email protected]/node_modules/openflights-cached/icaos.js:1:25:
      1 β”‚ module.exports = require("./dist/icaos.json");
        β•΅                          ~~~~~~~~~~~~~~~~~~~

X [ERROR] Could not resolve "./dist/icao.json"

    node_modules/.pnpm/[email protected]/node_modules/openflights-cached/icao.js:1:25:
      1 β”‚ module.exports = require("./dist/icao.json");
        β•΅                          ~~~~~~~~~~~~~~~~~~

10:26:02 PM [vite] (client) error while updating dependencies:
Error: Build failed with 6 errors:
node_modules/.pnpm/[email protected]/node_modules/openflights-cached/array.js:1:25: ERROR: Could not resolve "./dist/array.json"
node_modules/.pnpm/[email protected]/node_modules/openflights-cached/iata.js:1:25: ERROR: Could not resolve "./dist/iata.json"
node_modules/.pnpm/[email protected]/node_modules/openflights-cached/iata2icao.js:1:25: ERROR: Could not resolve "./dist/iata2icao.json"
node_modules/.pnpm/[email protected]/node_modules/openflights-cached/icao.js:1:25: ERROR: Could not resolve "./dist/icao.json"
node_modules/.pnpm/[email protected]/node_modules/openflights-cached/icaos.js:1:25: ERROR: Could not resolve "./dist/icaos.json"
...
    at failureErrorWithLog (C:\Users\Zubair\Desktop\Test\try-prisma-gh\node_modules\.pnpm\[email protected]\node_modules\esbuild\lib\main.js:1476:15)
    at C:\Users\Zubair\Desktop\Test\try-prisma-gh\node_modules\.pnpm\[email protected]\node_modules\esbuild\lib\main.js:945:25
    at C:\Users\Zubair\Desktop\Test\try-prisma-gh\node_modules\.pnpm\[email protected]\node_modules\esbuild\lib\main.js:1354:9
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
X [ERROR] Could not resolve require("./dist/icaos/**/*/**/*.json")

    node_modules/.pnpm/[email protected]/node_modules/openflights-cached/index.js:10:63:
      10 β”‚ const requireicao = (id) => self.icaos.includes(id) && require(`./dist/icaos/${id.substr(0,1)}/${id}.json`);  
         β•΅                                                                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~    

X [ERROR] Could not resolve "./dist/icaos.json"

    node_modules/.pnpm/[email protected]/node_modules/openflights-cached/icaos.js:1:25:
      1 β”‚ module.exports = require("./dist/icaos.json");
        β•΅                          ~~~~~~~~~~~~~~~~~~~

X [ERROR] Could not resolve "./dist/array.json"

    node_modules/.pnpm/[email protected]/node_modules/openflights-cached/array.js:1:25:
      1 β”‚ module.exports = require("./dist/array.json");
        β•΅                          ~~~~~~~~~~~~~~~~~~~

X [ERROR] Could not resolve "./dist/iata.json"

    node_modules/.pnpm/[email protected]/node_modules/openflights-cached/iata.js:1:25:
      1 β”‚ module.exports = require("./dist/iata.json");
        β•΅                          ~~~~~~~~~~~~~~~~~~

X [ERROR] Could not resolve "./dist/icao.json"

    node_modules/.pnpm/[email protected]/node_modules/openflights-cached/icao.js:1:25:
      1 β”‚ module.exports = require("./dist/icao.json");
        β•΅                          ~~~~~~~~~~~~~~~~~~

X [ERROR] Could not resolve "./dist/iata2icao.json"

    node_modules/.pnpm/[email protected]/node_modules/openflights-cached/iata2icao.js:1:25:
      1 β”‚ module.exports = require("./dist/iata2icao.json");
        β•΅                          ~~~~~~~~~~~~~~~~~~~~~~~

10:26:03 PM [vite] (client) error while updating dependencies:
Error: Build failed with 6 errors:
node_modules/.pnpm/[email protected]/node_modules/openflights-cached/array.js:1:25: ERROR: Could not resolve "./dist/array.json"
node_modules/.pnpm/[email protected]/node_modules/openflights-cached/iata.js:1:25: ERROR: Could not resolve "./dist/iata.json"
node_modules/.pnpm/[email protected]/node_modules/openflights-cached/iata2icao.js:1:25: ERROR: Could not resolve "./dist/iata2icao.json"
node_modules/.pnpm/[email protected]/node_modules/openflights-cached/icao.js:1:25: ERROR: Could not resolve "./dist/icao.json"
node_modules/.pnpm/[email protected]/node_modules/openflights-cached/icaos.js:1:25: ERROR: Could not resolve "./dist/icaos.json"
...
    at failureErrorWithLog (C:\Users\Zubair\Desktop\Test\try-prisma-gh\node_modules\.pnpm\[email protected]\node_modules\esbuild\lib\main.js:1476:15)
    at C:\Users\Zubair\Desktop\Test\try-prisma-gh\node_modules\.pnpm\[email protected]\node_modules\esbuild\lib\main.js:945:25
    at C:\Users\Zubair\Desktop\Test\try-prisma-gh\node_modules\.pnpm\[email protected]\node_modules\esbuild\lib\main.js:1354:9
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5) (x2)

2u841r avatar Feb 21 '25 16:02 2u841r

I'm not able to replicate this with npm or pnpm. What versions of those packages do you have?

jharrell avatar Feb 21 '25 16:02 jharrell

I'm not able to replicate this with npm or pnpm. What versions of those packages do you have?

pnpm --v 10.4.0 (and also tried with 9.4 something the day of creating this issue )

npm --v 10.9.2

please tell 3-5 person to run

npx try-prisma@latest --template accelerate/svelte-starter

and follow the https://github.com/prisma/prisma-examples/tree/latest/accelerate/svelte-starter I hope - at least some of them get one/some of my 3 problems.

2u841r avatar Feb 21 '25 16:02 2u841r

If you wouldn't mind, please run pnpm approve-builds, approve all options, and then run pnpm run dev again

jharrell avatar Feb 21 '25 16:02 jharrell

pnpm approve-builds

Zubair@DESKTOP-V22N2L0 MINGW64 ~/Desktop/Test/try-prisma-gh
$ pnpm approve-builds
√ Choose which packages to build (Press <space> to select, <a> to toggle all, <i> to invert selection) · @prisma/client, @prisma/engines, esbuild, openflights-cached, prisma

√ The next packages will now be built: @prisma/client, @prisma/engines, esbuild, openflights-cached, prisma.
Do you approve? (y/N) Β· true
node_modules/.pnpm/[email protected]/node_modules/esbuild: Running postinstall script...
node_modules/.pnpm/[email protected]/node_modules/esbuild: Running postinstall script, done in 122ms script, failed in 32ms
.../node_modules/openflights-cached postinstall$ bin/fetch.js
β”‚ 'bin' is not recognized as an internal or external command,
β”‚ operable program or batch file.
└─ Failed in 32ms at C:\Users\Zubair\Desktop\Test\try-prisma-gh\node_modules\.pnpm\[email protected]\node_modules\openflights-cached
node_modules/.pnpm/[email protected]/node_modules/esbuild: Running postinstall script, done in 127ms
node_modules/.pnpm/@[email protected]/node_modules/@prisma/engines: Running postinstall script...
 ELIFECYCLE  Command failed with exit code 1.

2u841r avatar Feb 21 '25 16:02 2u841r

Are you seeing this issue in a standard Windows installation? Are you using WSL?

jharrell avatar Feb 21 '25 17:02 jharrell

Are you seeing this issue in a standard Windows installation? Are you using WSL?

windows 11 home. (not WSL) I already usage many examples of Supabase, Cloudflare Workes, Clerk, Kinde, T3 etc. no problem occurred.

2u841r avatar Feb 21 '25 17:02 2u841r

Confirmed that this is an issue with Windows.

jharrell avatar Feb 21 '25 17:02 jharrell