-
Notifications
You must be signed in to change notification settings - Fork 234
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
Supabase fails to build after it installs on yarn 4 #1769
Comments
My current workaround is to manually download the
Because __dirname is not available in ES modules, we used import.meta.url to get the URL of the current module, and the url.fileURLToPath function to convert this URL into a file path. We then used path.dirname to get the directory name of this file path. After these changes, the postinstall script was able to read the checksum file from the local filesystem and continue with the installation process without any issues. Here is the full function:
and make sure to download the checksum manually. Hopefully someone from the Supabase team can look into this and figure out what's wrong with the |
I am having the same/similar issue. I am not able to reinstall the cli tool at all completely halting my local development. I used to have it installed and working but did a rm -rf to node_modules the other week. Since then I have not been able to reinstall the cli tools. I have not tried the manual install process listed above by Rob yet. Describe the bug npm i --save-dev supabase
npm ERR! code 1
npm ERR! path /Users/.../node_modules/supabase
npm ERR! command failed
npm ERR! command sh -c node scripts/postinstall.js
npm ERR! Downloading https://github.com/supabase/cli/releases/download/v1.127.3/supabase_darwin_arm64.tar.gz
npm ERR! Downloading https://github.com/supabase/cli/releases/download/v1.127.3/supabase_1.127.3_checksums.txt
npm ERR! file:///Users/jordan/Projects/jp/reno-fitness-lab/node_modules/supabase/node_modules/node-fetch/src/index.js:108
npm ERR! reject(new FetchError(`request to ${request.url} failed, reason: ${error.message}`, 'system', error));
npm ERR! ^
npm ERR!
npm ERR! FetchError: request to https://github.com/supabase/cli/releases/download/v1.127.3/supabase_1.127.3_checksums.txt failed, reason: read ECONNRESET
npm ERR! at ClientRequest.<anonymous> (file:///Users/.../node_modules/supabase/node_modules/node-fetch/src/index.js:108:11)
npm ERR! at ClientRequest.emit (node:events:513:28)
npm ERR! at TLSSocket.socketErrorListener (node:_http_client:494:9)
npm ERR! at TLSSocket.emit (node:events:513:28)
npm ERR! at emitErrorNT (node:internal/streams/destroy:151:8)
npm ERR! at emitErrorCloseNT (node:internal/streams/destroy:116:3)
npm ERR! at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
npm ERR! type: 'system',
npm ERR! errno: 'ECONNRESET',
npm ERR! code: 'ECONNRESET',
npm ERR! erroredSysCall: 'read'
npm ERR! }
npm ERR!
npm ERR! Node.js v18.17.0 The error message states that Supabase is having a ECONNRESET. Additionally, during the installation process, the entire network connection on the laptop becomes unresponsive. To Reproduce I am using the NextJS with Supabase, but I have also tried the install from a fresh npm init directory. I have used 2 different computers (M2 and intel chip). I have fiber at my house with 500Mbps down. I have also tried tethered to my phone. Steps to reproduce the behavior:
Expected behavior Desktop: |
This could be related to a bug in node-fetch node-fetch/node-fetch#1735. Let me switch the postinstall script to use native fetch. |
fwiw: I did just try with homebrew and I was able to get access back to the cli |
Yes but if that's no option and you need to use the one in the project, then it's difficult |
@RobSchilderr Totally agree. Just providing more data to help identify the issue |
I created a beta release with one of the suggested fixes. Could you try again with |
Tried it. ✹✭ ᐅ npx supabase@beta help
Need to install the following packages:
supabase@1.129.1
Ok to proceed? (y) y
✹✭ ᐅ npx supabase@beta help
Need to install the following packages:
supabase@1.129.1
Ok to proceed? (y) npm ERR! canceled The install took a long time. Then appeared to work as there were no errors. But no help was printed out. I tried the command again and was again prompted to install. |
It kept hanging for a while and ultimately gave this response:
The logs:
Hope this helps you further, really hope this could get solved for all new Macbook users! |
Did the logs above help you? |
I'm still unable to reproduce this error. Could you try the following and let me know if it works?
|
Yes this seems to work! What did this do? |
I believe there are some incompatibilities between node-fetch and native fetch in newer versions of node. Passing in the |
Alright, I'll pay attention to when this issue will be out of the beta release and test it once more! |
I still run into this issue, when will it be out of beta? |
I'm having the same issue |
Did my temporary solution also work for you? I still have this issue too. |
I will add the above workaround to our documentation. Changing the fetcher doesn't seem straightforward. |
I've added the |
I'm not sure if yarn supports dotenv natively yarnpkg/berry#4718. May be it's possible to update Even then, this is a nodejs config and not necessarily something yarn wants to handle. For simplicity, I'd suggest setting the env var before running yarn add command. You only need to do this once during installation so it's probably fine. |
ah , I've export |
What did you do exactly to fix it? When I run:
it keeps hanging on the installation, same issue, all the internet connection is lost. Then I added: However this still kept me hanging at: The only workaround for me that works is replacing the checksum manually but this is cumbersome to do every installation and new users with an M2/M3 chip will be lost. If anyone from the Supabase team wants to jump on a call to see what's going on, let me know. |
I have the same issue using npm or pnpm on Node v.20.12.2. |
Same issue |
Describe the bug
When trying to install Supabase using Yarn Berry 4.0.2 on a MacBook Pro with an M3 chip, the build process fails and exits with code 129. The error message states that Supabase must be built because it has never been built before or the last build failed. Additionally, during the installation process, the entire network connection on the laptop becomes unresponsive.
If I disable postinstall scripts with yarn it does install normally.
To Reproduce
Steps to reproduce the behavior:
I am using the Tamagui Takeout stack (https://tamagui.dev/takeout). So I guess a lot of people will run into it starting on a fresh new Macbook M3.
Once I got it working when I did
yarn cache clean
,npm cache clean --forece
and deleted all the node_modules. However it keeps failing which is why I decided to open this issue.Expected behavior
Supabase should be installed and postinstalled successfully without causing the network connection to become unresponsive.
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Additional context
The log file indicates that the postinstall script is trying to download the supabase CLI from https://github.com/supabase/cli/releases/download/v1.99.0/supabase_darwin_arm64.tar.gz and the checksums from https://github.com/supabase/cli/releases/download/v1.99.0/supabase_1.99.0_checksums.txt. However, it doesn't provide any further details about why the build process fails. The logs for the failed build can be found at /private/var/folders/9c/lzt260ms1dj647flwv171fc00000gn/T/xfs-6e918d5d/build.log. Also it happens with other versions, but Takeout starts with 1.99.0 at the moment.
The text was updated successfully, but these errors were encountered: