# Uncaught ReferenceError: exports is not defined

**URL:** https://discourse.roots.io/t/uncaught-referenceerror-exports-is-not-defined/28746
**Category:** bud
**Tags:** webpack, sage10
**Created:** 2024-10-03T01:25:02Z
**Posts:** 2

## Post 1 by @RistoKaalma — 2024-10-03T01:25:02Z

Pulled Sage 10 from commit `c6a21c4`, only only added `@roots/bud-typescript` and created `tsconfig.json` with the following contents:

```
{
  "extends": "@roots/bud-typescript/tsconfig/tsconfig.json"
}
```

This results in the following error on front-end console:

```
Uncaught ReferenceError: exports is not defined
    at ./scripts/app.js (app.49df6a.js:1:227)
    at t (demo/:546:127)
    at e (app.49df6a.js:1:345)
    at app.49df6a.js:1:354
    at r (demo/:546:854)
    at app.49df6a.js:1:86
./scripts/app.js @ app.49df6a.js:1
t @ demo/:546
e @ app.49df6a.js:1
(anonymous) @ app.49df6a.js:1
r @ demo/:546
(anonymous) @ app.49df6a.js:1
```

…and the following in block editor console:

```
Uncaught ReferenceError: exports is not defined
    at ./scripts/editor.js (editor.ad595a.js:1:1150)
    at t (post.php?post=7&action=edit:2059:127)
    at r (editor.ad595a.js:1:1656)
    at editor.ad595a.js:1:1665
    at r (post.php?post=7&action=edit:2059:854)
    at editor.ad595a.js:1:73
./scripts/editor.js @ editor.ad595a.js:1
t @ post.php?post=7&action=edit:2059
r @ editor.ad595a.js:1
(anonymous) @ editor.ad595a.js:1
r @ post.php?post=7&action=edit:2059
(anonymous) @ editor.ad595a.js:1
```

I’ve used `@roots/bud-typescript` in many other projects so far. This started happening yesterday.

node v20.16.0  
yarn v1.22.22

I’m out of ideas on how to troubleshoot this. Any suggestions? Anyone else having this problem?

---

## Post 2 by @LucasDemea — 2024-10-16T09:56:40Z

I had the same error. My workaround was to specify

```
"module": "esnext",
    "moduleResolution": "node",
```

in my tsconfig.json.  
These settings were supposed to already be imported from

```
"extends": "@roots/bud-typescript/tsconfig/tsconfig.json"
```

so i’m not sure why they wouldn’t work. They may be overridden by another roots package ?
