Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stdout maxBuffer exceeded with Rust #1573

Closed
remexre opened this issue Jun 18, 2018 · 4 comments
Closed

stdout maxBuffer exceeded with Rust #1573

remexre opened this issue Jun 18, 2018 · 4 comments
Labels

Comments

@remexre
Copy link

remexre commented Jun 18, 2018

🐛 bug report

🎛 Configuration (.babelrc, package.json, cli command)

No .babelrc, using parcel serve --no-hmr src/index.html (via npm run serve).

{
  "author": "Nathan Ringo <remexre@gmail.com>",
  "bugs": {
    "url": "https://github.com/remexre/evaltrees/issues"
  },
  "description": "The web port of evaltrees.",
  "dependencies": {
    "xterm": "^3.4.1"
  },
  "devDependencies": {
    "parcel-bundler": "^1.9.1"
  },
  "homepage": "https://github.com/remexre/evaltrees#readme",
  "license": "Apache-2.0 OR MIT",
  "main": "src/index.html",
  "name": "evaltrees",
  "repository": {
    "type": "git",
    "url": "git+https://github.com/remexre/evaltrees.git"
  },
  "scripts": {
    "build": "parcel build --detailed-report src/index.html",
    "serve": "parcel serve --no-hmr src/index.html",
    "watch": "parcel watch src/index.html"
  },
  "version": "0.1.0"
}

🤔 Expected Behavior

Ideally it'd compile :P

😯 Current Behavior

When trying to build a Rust project, I get stdout maxBuffer exceeded:

🚨  /home/nathan/Projects/evaltrees/src/lib.rs: stdout maxBuffer exceeded
    at Socket.onChildStdout (child_process.js:328:14)
    at emitOne (events.js:116:13)
    at Socket.emit (events.js:211:7)
    at addChunk (_stream_readable.js:263:12)
    at readableAddChunk (_stream_readable.js:246:13)
    at Socket.Readable.push (_stream_readable.js:208:10)
    at Pipe.onread (net.js:607:20)

💻 Code Sample

index.js:

import evaltrees from "../../src/lib.rs";
import ui from "./ui.js";

console.log("test");

The Rust code is unchanged from this commit.

🌍 Your Environment

Software Version(s)
Parcel 1.9.1
Node 8.11.1
npm/Yarn npm 5.6.0
Operating System Arch Linux
rustc 1.26.2
cargo 1.26.0
@rail-rain
Copy link

If you use stdweb or wasm-bindgen, you can avoid this bug by using parcel-plugin-cargo-web or parcel-plugin-wasm.rs.

@devongovett devongovett added WASM Web Assembly Rust labels Jan 6, 2019
@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs.

@github-actions github-actions bot added the Stale Inactive issues label Jan 17, 2020
@github-actions github-actions bot closed this as completed Feb 2, 2020
@cedric-h
Copy link

I'm still getting this

@github-actions github-actions bot removed the Stale Inactive issues label Feb 16, 2020
@rail-rain
Copy link

rail-rain commented Feb 17, 2020

the main cause of the error stdout maxBuffer exceeded when using RustAsset is the execution of cargo metadata here because cargo metadata emits every data. The other causes' possibilities are avoidable.

I can think of three solutions:

  1. Extending maxBuffer of execFile.
  2. Using spawn, which doesn't have a buffer limit thanks to streams, instead of execFile.
  3. Setting no-deps option in cargo metadata, which omits information about dependencies and significantly reduces the size of output.

Setting no-deps seems to have no disadvantages and be easy to do. However, RustAsset are being replaced and the new one might not have the problem somehow.

tronical added a commit to slint-ui/slint that referenced this issue Oct 5, 2020
We're running into parcel-bundler/parcel#1573
so switch back to webpack.
tronical added a commit to slint-ui/slint that referenced this issue Oct 5, 2020
We're running into parcel-bundler/parcel#1573
so switch back to webpack.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants