t3-oss / create-t3-app

The best way to start a full-stack, typesafe Next.js app
https://create.t3.gg
MIT License
25.58k stars 1.18k forks source link

bug: Crypto not defined in envVars cli installer #2009

Closed swyckoff closed 2 weeks ago

swyckoff commented 2 weeks ago

Provide environment information

  System:
    OS: macOS 14.1
    CPU: (16) arm64 Apple M3 Max
    Memory: 4.21 GB / 64.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 18.18.2 - ~/.nvm/versions/node/v18.18.2/bin/node
    Yarn: 1.22.21 - /opt/homebrew/bin/yarn
    npm: 9.8.1 - ~/.nvm/versions/node/v18.18.2/bin/npm
    pnpm: 9.12.1 - /opt/homebrew/bin/pnpm

Describe the bug

The envVariables cli runner fails to install because of an undefined package:

Adding boilerplate...
✔ Successfully setup boilerplate for drizzle
✔ Successfully setup boilerplate for tailwind
⠋ Boilerplating envVariables...Aborting installation...
ReferenceError: crypto is not defined

We should see this:


Adding boilerplate...
✔ Successfully setup boilerplate for drizzle
✔ Successfully setup boilerplate for tailwind
✔ Successfully setup boilerplate for envVariables
✔ Successfully setup boilerplate for eslint

Reproduction repo

https://github.com/t3-oss/create-t3-app

To reproduce

Scaffold with:

Additional information

No response

AkritW commented 2 weeks ago

I also got the same problem

raihanmd commented 2 weeks ago

i got this problem too

juliusmarminge commented 2 weeks ago

i'll soon be releasing the new version where we use node:crypto instead of global crypto

ooc, what your node version? globalThis.crypto has been around for a bit now

raihanmd commented 2 weeks ago

18.20.4

raihanmd commented 2 weeks ago

nvm im using node v20 and its work

juliusmarminge commented 2 weeks ago

CleanShot 2024-11-04 at 09 55 31

18.20 seems like it should work too

AkritW commented 2 weeks ago

I just tested it out as per the latest update. Node v18 doesn't work, even though v20 does work.