Creating env from Windows causes errors.
Bug report
- [x ] I confirm this is a bug with Supabase, not with my own application.
- [x ] I confirm I have searched the Docs, GitHub Discussions, and Discord.
Describe the bug
Supabase CLI 1.50.11 on Windows 11
.env file
TEST="TEST"
command
supabase secrets set --env-file ./supabase/.env --debug
ouputs
Error: unexpected character "\x00" in variable name near "\xff\xfeT\x00E\x00S\x00T\x00=\x00\"\x00T\x00E\x00S\x00T\x00\"\x00"
When I create my env files from WSL, the extra null characters are not attached. I tried changing between CRLF/LF but found that the only remedy was to recreate the files via wsl. There is likely some sanitation of the files that can be done before parsing to ensure compatibility across hosts.
Can you check the file encoding of your .env file? If you create a file in WSL vs. Windows, do they have different encodings/file endings?
Changing the line endings didn't seem to do much. Probably could be caught by a generalized null character stripper during your serialization process. Seems Windows creates the files with additional null characters but not linux.
File encodings orthogonal to line endings. You should be able to check for these like so - not able to do it myself since I don't have a Windows box
Both are created UTF8 encoded, only visible difference in the newly created file is the line endings. CRLF (Windows), LF (Linux). Changing the windows generated file to LF does not seem to effect the CLI bug.
I got same problem. Did you solve that ?
I ran into this issue when I piped the output of status to the .env file using the following command.
npx supabase status -o env > .env
I had to clear my .env file and just recreate it. I assume it was some special character but when toggling render whitespace in vscode I didn't see anything, however the application did put it out to have CRLF as my line feeds.
I am using Windows also and supabase cli made me crazy. It even not let me to write my database password to terminal tried every way possible for just taking the types file. Finally i found solution on linking my database without entering a password and i still don't know how it let me do that.
I faced the same issue in .env.local file. Just delete and create the file again. It works for me.