importing an image via import hamster from 'url:./img/NotFound/hamster.png results in a build loop, which in turn causes a memory leak.
"babel": {
"presets": [
"@babel/preset-typescript",
"babel-preset-nano-react-app"
]
}
from nano-react-app/nano-react-app
... Image gets imported, no build loop.
parcel index.html results in a build loop. No error is printed and the page imports the image properly.
ยฏ\_(ใ)_/ยฏ
Importing an image and using it via <img src={hamster} />. This is pretty basic usage.
import * as React from "react";
import { Link } from "react-router-dom";
import hamster from 'url:./img/NotFound/hamster.png';
export default class NotFound extends React.Component {
render() {
return (
<div>
<h1>Page not found</h1>
<h2>Make sure you entered the link correctly.</h2>
<div>
<img src={hamster} />
<Link to="/" className="button">Back home</Link>
</div>
</div>
);
}
}
| Software | Version(s) |
| ---------------- | ---------- |
| Parcel | ^2.0.0-alpha.3.2
| Node | v12.16.3
| npm/Yarn | Yarn 1.22.4
| Operating System | Fedora 32
Please provide a more complete code sample (ideally a repository) to reproduce this
Please provide a more complete code sample (ideally a repository) to reproduce this
@mischnic CC ^
I've provided a repository to reproduce the bug. Please remove the waiting label?
I got exactly the same issue. When I start I get this error:
MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 13 error listeners added to [WriteStream]. Use emitter.setMaxListeners() to increase limit.
Then it says built in x ms and goes back to bundling. Those builds are all around 200ms. Meanwhile my rams filling up like crazy.
I've provided a repository to reproduce the bug.
Works fine on macOS. I'll have to test with Linux...
I don't get a build loop in a Fedora VM either...
@mischnic That's strange, could you perhaps test the repository in #5178?
I'm using Windows Insiders 2004 with VSCode, if that matters. Node version v14.5.0.
You mean as a VM host or that you experienced this on both OSs?
Windows Insiders 2004
Operating System | Fedora 32
could you perhaps test the repository in #5178?
Same behavior: when starting Parcel in serve mode, it builds and then idles after the first build: Built in 32s.
You mean as a VM host or that you experienced this on both OSs?
Windows Insiders 2004
Operating System | Fedora 32
Oh my bad, I experienced this on both OSes, yes.
I am having the same issue. For me, deleting the .parcel-cache usually fixes it for a couple of days, after which the issue reappears. I was unable to isolate which code change exactly causes the problem.
Windows 10 2004 user here.
Hello, I am experiencing the same issue. I cannot provide a comprehensive code sample because my issue is within my employer's codebase. However, it surfaces as soon as I import a PNG using the following line:
import Logo from 'url:../assets/logo.png';
It is not resolved by removing the import and restarting the build (parcel serve). It is only resolved by removing the import, stopping the build, deleting .parcel-cache, and then resuming the build. I have not seen it resurface after doing that, but I have not attempted any further image imports.
Thank you.
I have similar issue but in my case the builder flips over when I try to import component from JS file stored outside of the root folder of the project.
I got not only tones of memory leaks errors but also bunch of other errors, package.json gets wiped completely and parcel.exe gets removed from .bin folder.
I will create a new issue later once I will find a spare minute to create reproducible repo. Just giving you heads up in case it's somehow related.