# "TypeError: Failed to fetch" error when trying to upload  a Pre or Post Script in Cloud

*Applies to: Patch My PC Cloud*

### SYMPTOMS

I am trying to upload a Pre (or Post) script, but I get the following error:

**Error - TypeError: Failed to fetch**

<figure><img src="/files/SjEuWbmp52c641R9Z3hH" alt="Error - TypeError: Failed to fetch" width="350"><figcaption></figcaption></figure>

### CAUSE

This error can happen if your pre/post script contains either of the following variables:

`"${env:ProgramFiles(x86)}"`

`"${env:ProgramFiles}"`

This issue is not caused by the Patch My PC (PMPC) Cloud portal but by Cloudflare, who are incorrectly identifying them as a false-positive and blocking the upload as they think the script is a Log4j exploit.

### RESOLUTION

As Cloudflare is causing this issue, we cannot implement a fix. We are actively working with them to try to resolve this false positive.

In the meantime, to work around this issue, use the following replacements in your affected scripts:

<table><thead><tr><th valign="top">Replace all instances of…</th><th valign="top">With...</th></tr></thead><tbody><tr><td valign="top"><code>"${env:ProgramFiles(x86)}"</code></td><td valign="top"><code>"$($env:SystemDrive)\Program Files (x86)"</code></td></tr><tr><td valign="top"><code>"${env:ProgramFiles}"</code></td><td valign="top"><code>"$($env:SystemDrive)\Program Files"</code></td></tr></tbody></table>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.patchmypc.com/patch-my-pc-cloud/troubleshoot/deployments/typeerror-failed-to-fetch-error-when-trying-to-upload-a-pre-or-post-script-in-cloud.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
