Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
2u841r opened this issue Jan 20, 2025 · 9 comments
Open

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

2u841r opened this issue Jan 20, 2025 · 9 comments
Labels

Comments

@2u841r
Copy link

2u841r commented Jan 20, 2025

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"]
}

@jharrell
Copy link
Member

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

@2u841r
Copy link
Author

2u841r commented Feb 21, 2025

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)

@jharrell
Copy link
Member

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

@2u841r
Copy link
Author

2u841r commented Feb 21, 2025

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.

@jharrell
Copy link
Member

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

@2u841r
Copy link
Author

2u841r commented Feb 21, 2025

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.

@jharrell
Copy link
Member

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

@2u841r
Copy link
Author

2u841r commented Feb 21, 2025

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.

@jharrell jharrell added the Bug label Feb 21, 2025
@jharrell
Copy link
Member

Confirmed that this is an issue with Windows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants