question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Vite build fails with esbuild error

See original GitHub issue

Describe the bug

I just invested for the redesign of my own project HowCanI with replacing Tailwind with the ready to use MaterialUI library Svelte Materialify. After I’m done with it I wanted finally run vite build and it fails with an follwing esbuild-error:

Is there any way, to find out, what exactly the issue is and what I could do to fix it?

How to reproduce:

  • https://github.com/janbaer/howcani.git
  • git checkout feature/css-redesign
  • yarn install
  • yarn build or npx vite build

It would be great to get some hints, how to solve the issue. On the master branch the build is still working fine. Also Vite is running in my feature branch in the dev mode without any issues.

Thanks in advance!

Reproduction

System Info

This is the output of 


npx envinfo --system --npmPackages '{vite,@vitejs/*,svelte}' --binaries --browsers
  System:
    OS: Linux 5.4 Manjaro Linux
    CPU: (8) x64 Intel(R) Core(TM) i7-7700T CPU @ 2.90GHz
    Memory: 9.17 GB / 15.33 GB
    Container: Yes
    Shell: 5.8 - /usr/bin/zsh
  Binaries:
    Node: 16.9.1 - ~/.nvm/versions/node/v16.9.1/bin/node
    Yarn: 1.22.17 - /usr/bin/yarn
    npm: 7.21.1 - ~/.nvm/versions/node/v16.9.1/bin/npm
  Browsers:
    Chromium: 96.0.4664.110
    Firefox: 95.0.2
  npmPackages:
    svelte: 3.45.0 => 3.45.0
    vite: 2.7.10 => 2.7.10


### Used Package Manager

yarn

### Logs

```shell
rendering chunks...
events.js:377
      throw er; // Unhandled 'error' event
      ^

Error: write EPIPE
    at afterWriteDispatched (internal/stream_base_commons.js:156:25)
    at writeGeneric (internal/stream_base_commons.js:147:3)
    at Socket._writeGeneric (net.js:798:11)
    at Socket._write (net.js:810:8)
    at writeOrBuffer (internal/streams/writable.js:358:12)
    at Socket.Writable.write (internal/streams/writable.js:303:10)
    at Object.writeToStdin (/home/runner/work/howcani/howcani/node_modules/esbuild/lib/main.js:1864:19)
    at sendRequest (/home/runner/work/howcani/howcani/node_modules/esbuild/lib/main.js:637:14)
    at Object.formatMessages2 [as formatMessages] (/home/runner/work/howcani/howcani/node_modules/esbuild/lib/main.js:1348:5)
    at /home/runner/work/howcani/howcani/node_modules/esbuild/lib/main.js:1931:55
Emitted 'error' event on Socket instance at:
    at emitErrorNT (internal/streams/destroy.js:106:8)
    at emitErrorCloseNT (internal/streams/destroy.js:74:3)
    at processTicksAndRejections (internal/process/task_queues.js:82:21) {
  errno: -32,
  code: 'EPIPE',
  syscall: 'write'


### Validations

- [X] Follow our [Code of Conduct](https://github.com/vitejs/vite/blob/main/CODE_OF_CONDUCT.md)
- [X] Read the [Contributing Guidelines](https://github.com/vitejs/vite/blob/main/CONTRIBUTING.md).
- [X] Read the [docs](https://vitejs.dev/guide).
- [X] Check that there isn't [already an issue](https://github.com/vitejs/vite/issues) that reports the same bug to avoid creating a duplicate.
- [X] Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to https://github.com/vuejs/vue-next instead.
- [X] Check that this is a concrete bug. For Q&A open a [GitHub Discussion](https://github.com/vitejs/vite/discussions) or join our [Discord Chat Server](https://chat.vitejs.dev/).
- [X] The provided reproduction is a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) of the bug.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
janbaercommented, Apr 2, 2022

It’s working in the meantime fine for me, after updating from vite 2.7 to 2.8. Sorry that I forgot to close the issue

1reaction
janbaercommented, Jan 12, 2022

I found a workaround for my build problem. When I deactivate the minification in the build options, the build finishes without any error. But of course the asset folder is now more than 1 MB.

So the issue comes clearly from the code minifaction with esbuild. But what exactly causes the issue, I don’t know.

Read more comments on GitHub >

github_iconTop Results From Across the Web

I keep getting an error in Vite version 3.2.4 which says ` ...
javascript - I keep getting an error in Vite version 3.2. 4 which says `[vite:esbuild] The service is no longer running: write EPIPE`...
Read more >
Troubleshooting
Vite cannot handle and does not support code that only runs on non-strict mode (sloppy mode). This is because Vite uses ESM and...
Read more >
Getting Started - ESBuild
js=jsx flag. You can read more about the available configuration options in the API documentation. #Build scripts. Your build command is something you...
Read more >
yarn create vite error - You.com | The AI Search Engine ...
I believe that those two errors are unrelated, so for that matter, ... at build (C:\Users\brc-dd\Desktop\foo\.yarn\unplugged\esbuild-npm-0.14.48-d0430cb883\ ...
Read more >
Failed to load config from vite.config.js
vite build failed to load config from /Users/Sites/hub/vite.config.js error during build: Error: Cannot find module 'node:path' Require stack: ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found