<p>I copied the Plutus starter template, <em><a href="https://github.com/input-output-hk/plutus-starter" rel="nofollow noreferrer">Plutus Platform starter project</a></em>, and created a file, <code>BasicPlutusTx.hs</code> (and added it under <code>exposed-modules</code> in the <code>.cabal</code> file).</p>
<p>Then I started copying over all the code from the introductory tutorial, <em><a href="https://plutus.readthedocs.io/en/latest/plutus/tutorials/plutus-tx.html" rel="nofollow noreferrer">Using Plutus Tx</a></em>.</p>
<p>When I added the code,</p>
<pre><code>functions :: CompiledCode Integer
functions = $$(compile [|| myProgram ||])
</code></pre>
<p>it caused Visual Studio Code to complain, giving an error at the top of the file:</p>
<pre><code>Program error: GHC Core to PLC plugin: E043:Error: Reference to a name which is not a local, a builtin, or an external INLINABLE function: Variable PlutusTx.Builtins.addInteger
            No unfolding
Context: Compiling expr: PlutusTx.Builtins.addInteger
Context: Compiling expr: PlutusTx.Builtins.addInteger
                           (PlutusTx.Builtins.addInteger 1 1)
Context: Compiling expr: PlutusTx.Builtins.addInteger
                           (PlutusTx.Builtins.addInteger 1 1) (BasicPlutusTx.plusOne 1)
Context: Compiling definition of: BasicPlutusTx.myProgram
Context: Compiling expr: BasicPlutusTx.myProgram
Context: Compiling expr at &quot;main:BasicPlutusTx:(76,16)-(76,41)&quot;compile
</code></pre>
<p>However, <code>cabal build</code> still works.</p>

CC BY-SA 4.0
2022-01-17T05:32:18.677Z
If I recall correctly, this error can happen during the first evaluation, but will be gone during subsequent ones. This is due to unfolding not be available from the start, but only once the module has been compiled for the first time.
angerman
CC BY-SA 4.0
2022-01-19T03:02:16.107Z
@angerman Am I running VSCode wrong? I'm starting `nix-shell` and then calling `code` from there
dspyz
CC BY-SA 4.0
2022-01-19T03:25:48.867Z
I see there's a flag in the project which enables the fix, but I don't see how or why VSCode would enable this flag
dspyz
CC BY-SA 4.0
2022-01-22T12:00:33.130Z
Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.
Community
<plutustx><plutus-starter><vscode><error>
"No unfolding" error in Visual Studio Code
# "No unfolding" error in Visual Studio Code

(Asked by: username_0 on 2022-01-16)

I copied the Plutus starter template, Plutus Platform starter project, and created a file, BasicPlutusTx.hs (and added it under exposed-modules in the .cabal file).
Then I started copying over all the code from the introductory tutorial, Using Plutus Tx.
When I added the code,
functions :: CompiledCode Integer
functions = $$(compile [|| myProgram ||])

it caused Visual Studio Code to complain, giving an error at the top of the file:
Program error: GHC Core to PLC plugin: E043:Error: Reference to a name which is not a local, a builtin, or an external INLINABLE function: Variable PlutusTx.Builtins.addInteger
            No unfolding
Context: Compiling expr: PlutusTx.Builtins.addInteger
Context: Compiling expr: PlutusTx.Builtins.addInteger
                           (PlutusTx.Builtins.addInteger 1 1)
Context: Compiling expr: PlutusTx.Builtins.addInteger
                           (PlutusTx.Builtins.addInteger 1 1) (BasicPlutusTx.plusOne 1)
Context: Compiling definition of: BasicPlutusTx.myProgram
Context: Compiling expr: BasicPlutusTx.myProgram
Context: Compiling expr at "main:BasicPlutusTx:(76,16)-(76,41)"compile

However, cabal build still works.

**Tags:** plutustx, plutus-starter, vscode, error
> **Comments:**
> **username_1**: If I recall correctly, this error can happen during the first evaluation, but will be gone during subsequent ones. This is due to unfolding not be available from the start, but only once the module has been compiled for the first time.  
> **username_0**: @angerman Am I running VSCode wrong? I'm starting `nix-shell` and then calling `code` from there  
> **username_0**: I see there's a flag in the project which enables the fix, but I don't see how or why VSCode would enable this flag  
> **username_2**: Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.  

---

## 0 answers

