---
title: "TS8034 BARRIER_PLACEMENT: a TypeShade compiler error code"
description: "TS8034 BARRIER_PLACEMENT, an error code of the TypeShade compiler. workgroupBarrier() or storageBarrier() where a barrier cannot stand…"
url: https://typeshade.dev/reference/errors/ts8034/
language: en
---

# `TS8034`

Front-end code `BARRIER_PLACEMENT`

`workgroupBarrier()` or `storageBarrier()` where a barrier cannot stand: in a vertex or fragment entry, which has no workgroup, or as a value, since a barrier is a statement. A barrier under control flow that the invocations do not share is `UNIFORMITY`.

The registry has no documentation comment for this constant, so the line above is written by this site from the messages the compiler raises it with.

The registry text and every compiler message on these pages are the compiler's own English.

## Example

example.shade.ts

```ts
"use typeshade"

@fragment
export function main(uv: location<0, vec2>): vec4 {
  workgroupBarrier()
  return vec4(uv, 0., 1.)
}
```

Compiled at build time against the pinned compiler, this program gets:

**TS8034** error, line 5: `workgroupBarrier`() belongs in a compute entry or a function it calls; a fragment entry has no workgroup to wait for.

## How to fix it

The same program, corrected. It compiles with no diagnostic.

example.shade.ts

```ts
"use typeshade"

@fragment
export function main(uv: location<0, vec2>): vec4 {
  return vec4(uv, 0., 1.)
}
```

## The rule this enforces

**[Rule 8.3](https://typeshade.dev/reference/rules/8-3/) Test**

A builtin WGSL confines by stage may be used in an entry of a permitted stage, and in a helper that no entry of an excluded stage can reach.

## See also

- [Control flow](https://typeshade.dev/guide/language/control-flow/)
- [Error codes](https://typeshade.dev/reference/errors/)

## Source

Where the compiler raises this code at commit af54ddad5, one line per file:

- [`src/compiler/ts/lower/barriers.ts:46`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/lower/barriers.ts#L46)
- [`src/compiler/ts/lower/expression-call.ts:471`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/lower/expression-call.ts#L471)
- [`src/compiler/ts/stage-restrictions.ts:108`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/stage-restrictions.ts#L108)
