thunderclient / thunder-client-support

Thunder Client is a lightweight Rest API Client Extension for VS Code.
https://www.thunderclient.com
Other
3.64k stars 130 forks source link

env files are not loaded/saved #1424

Closed tringler-atos closed 11 months ago

tringler-atos commented 11 months ago

Describe the bug If import an env file the content is not loaded. If I link an env file and click on save the content is not wrote to that file. If I export an env file it is working.

To Reproduce Export an env file and try to re-import it.

Expected behavior The env file content is loaded/saved.

Platform:

Are you using the free version/paid version/trial: paid

rangav commented 11 months ago

Hi @tringler-atos

I just now exported the environment from TC and imported the env file. It's working for me.

Are you referring to .env files or TC environment files?

tringler-atos commented 11 months ago

I'm referring to .env files - These you can create beside of the global and local TC env files.

rangav commented 11 months ago

The extension will not write back to .env file when you link it. its a read only operation that is by design.

tringler-atos commented 11 months ago

Import worked now. I removed the env from TC, added a new variable on the json and imported back to TV. After reloading TC I'm getting Sidebar Load Error: Cannot read properties of undefined (reading 'replace')

If I remove the env file from environments folder it's back working. As I imported the env file the variable I manually edited is visible, so it seems to be deserialized correctly.

Any idea?

tringler-atos commented 11 months ago

I was able to solve it by myself. For some reason the header in my env was missing:

    "default": true,
    "sortNum": 9999,
    "created": "2023-11-23T23:35:55.898Z",
    "modified": "2023-11-23T23:35:55.898Z",