solidjs / solidjs/solid-playground

Build error - ESM file cannot be loaded by `require`

Open
#174 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
244
Forks
69
PR merge metrics
No merged PRs in 30d

Description

Checking out the project and pnpm i and pnpm run dev throws the following error:

✘ [ERROR] "unocss/vite" resolved to an ESM file. ESM file cannot be loaded by require. See https://vitejs.dev/guide/troubleshooting.html#this-package-is-esm-only for more details. [plugin externalize-deps]

I was able to fix by adding

"type": "module", to the playground package.json

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the error with pnpm i and pnpm run dev, then inspect the playground package.json mentioned in the issue. The change is complete when the development command no longer reports that unocss/vite is an ESM file loaded by require.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript, vite
Domain
build-system
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.