egoist / egoist/tsup

5.10.3 -> 5.11.0 (and later) in a Vite project: "Uncaught ReferenceError: require is not defined"

Open
#691 0 comments 3 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
11.3k
Forks
275
PR merge metrics
No merged PRs in 30d

Description

When I update from 5.10.3 to 5.11.0 (or later) I get the following error:

```
Uncaught ReferenceError: require is not defined
at jsx-runtime.js:6:3
```

It's worth to note that I am using the compiled library in a Storybook + Vite environment.

I am trying to upgrade tsup in this starter project: https://github.com/vercel/turborepo/tree/main/examples/design-system

Sorry that I cannot provide any more information. It's not urgent on my side, but I wanted to document it somewhere in case someone stumbles onto the same issue.

Contributor guide

Open the contributing guide

Research direction

Reproduce the upgrade in the Turborepo design-system starter project using its Storybook + Vite setup, then inspect the generated jsx-runtime.js at line 6 where require is referenced. Compare the output from 5.10.3 and 5.11.0; done means the compiled library loads without the ReferenceError.

Written by the indexing model from the issue text.

Assessment

Tech stack
storybook, typescript, vite
Domain
build-system, frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.