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
Inconsistent Build Behavior & Errors While Building #7645
Comments
I've continued chipping away at this, trying to get to a minimal reproducible project. I've been chipping away at the code. There's still quite a lot left, but I've reached a state where it doesn't matter what I do, the code moves from broken to functional. For example, some states that I've seen...
It doesn't matter what file I'm in. There seems to be something I can do to make it switch from "it doesn't work" to "it works." And there's no rhyme or reason why. It almost feels like there's something going on with content length that's causing it to go sideways. As an example...
🔼 This also fails.
So,
🔼 Fails.
🔼 Fails.
This length thing would explain why I've had such a hard time pinning it down. I've been focused on "what's wrong with the code," deleting and changing sections. But it seems that the problem may actually be related to the amount of code in the file I'm modifying (they're not overly long—the file this experimentation was done on is only ~105 lines). |
I am getting this same exact error: ⠏ Optimizing index.[hash].js...
node:internal/streams/buffer_list:97
return this.head.data;
^
TypeError: Cannot read properties of null (reading 'data')
at BufferList.first (node:internal/streams/buffer_list:97:22)
at howMuchToRead (node:internal/streams/readable:385:27)
at TapStream.Readable.read (node:internal/streams/readable:430:7)
at flow (node:internal/streams/readable:1012:34)
at resume_ (node:internal/streams/readable:993:3)
at processTicksAndRejections (node:internal/process/task_queues:83:21)
It works with This build command fails: "build": "NODE_ENV=production parcel build --no-source-maps src/index.html" If I remove the "build": "NODE_ENV=production parcel build src/index.html" When I tried it on an Ubuntu 18.04 OS with Node 14.17.1 it worked with the Edit: I just tested it on Windows 10 with Node 15.14.0 and it also worked there with the |
Pulling the thread that @JennaSys found... So |
I already have to retract that previous statement... That was the behavior in the pared down demo I was trying to pull together. When I took that technique back to the full project, it didn't change anything. |
It did seem to be somewhat random at first for me too, but what I outlined was consistent after trying different combinations repeatedly (6-10 times). I will say that I could have sworn this was working fine just a week ago with the same source and top level dependency versions. I first noticed this behavior yesterday after a full build from scratch. I will continue testing different variations, but so far the common denominator in these 2 instances seems to be Node 16.13.2 |
OK, I think I may have found the culprit. By comparing the package-lock.json files between a recent build and an older working build of the same project, it's the Pinning this dependency to "devDependencies": {
"lmdb": "2.1.7",
"parcel": "^2.2.1"
} It appears to be a dependency of @antoinne85 can you see if this fixes it for you as well? |
I can confirm that reverting lmdb fixes the build. "resolutions": {
"lmdb": "2.1.7"
} |
The problem does also appear to be specific to Node 16 as well, since it still seems to work with lmdb==2.2.0 on Node 14 & Node 15 Edit: Nevermind, I checked again and it breaks with Node 15 too. |
cc. @kriszyp |
I have not been able to reproduce this, and I'm not sure if anyone has come up with a reliable set of steps for reproducing this yet. If they do, I would be glad to investigate further. In the meantime, there a couple of performance optimizations that I recently made to lmdb-js in v2.2.0, that I had actually hoped would provide performance benefits to parcel, but possibly one of the could be the source of this regression. If these are only occurring in a closed environment, perhaps maybe someone would be graciously willing to try flipping some of these switches:
|
@kriszyp I can confirm that increasing the threshold value in /node_modules/lmdb/dist/index.cjs does fix the issue in my case. I changed it from |
@JennaSys Thank you for checking on this for me. I actually still have no idea what is going wrong, I can't see how this would be failing, but I will release a new version with this optimization disabled, until I can figure it out. |
Ok, the main optimization that I believe was affecting parcel should be reverted in lmdb@v2.2.1. Again, if anyone is able to offer any more clues on how to reproduce this, would love to know, as I haven't been able to find any issues with how it was working. |
@kriszyp, I was just using a simple React demo app I had laying around to test out a parcel transformer for Python that I developed when I encountered this issue. It's a bit of an odd example since the original source is Python, but since the issue happens after the transpilation process, it shouldn't really matter. You are more than welcome to use it to try and reproduce the issue yourself if it helps. (I did put an override in package.json for |
…ionary buffer on each large decompression and fix check for restoring buffer when using compression, parcel-bundler/parcel#7645
@JennaSys Thank you! I was able to reproduce this with your directions, and I believe I was able to implement a proper fix for the optimization (will release in v2.2.2, but v2.2.1 should be safe for now). |
That's fantastic - and thanks for the quick turnaround @kriszyp! |
We seem to encounter this bug in a monorepo case. build step in package.json of both packages:
When running We also get a coredump for Attach Using lmdb 2.1.7 seems to fix this issue for us as well. |
@valkum Are you saying that you see this problem in lmdb 2.2.1 or 2.2.0? It should be fixed in 2.2.1, but let me know if that is not the case. |
We see that with 2.2.1 |
As you think this might not be related to the possible fixed issues raised here, I opened a new issue for this. Feel free to close that new one as a dup if this resolves to being caused by the same possible issues raised here. |
Looks like this has been fixed |
🐛 bug report
I'm getting inconsistent build behavior. I get errors every time. But if I start making modifications to files, sometimes the build will succeed. Once it succeeds once, subsequent builds succeed. However, when debugging in Chrome, the debugger's position is out of sync with the file contents (I can tell that it's executing a different line than the UI indicates).
Once I get a successful build, I can quit and then attempt the build again and it will succeed, albeit with the above oddities. Clearing the output folder and cache takes me back to a non-buildable state (with the same source files).
I really hate bringing this to your team without a reproducible sample in-hand, but I've been searching and working on this issue for hours now and haven't made any meaningful progress towards understanding the issue or narrowing it down. I intend to ask some other engineers to build it in the morning to try to narrow it down further—maybe it's an environmental issue, though it seems somewhat unlikely.
🎛 Configuration (.babelrc, package.json, cli command)
Running
yarn parcel test-index.html
🤔 Expected Behavior
Expected it to build/launch.
😯 Current Behavior
I'm getting the following error...
The precise text before the error varies (e.g. bundling, bundling runtime, packaging test-index.html, etc.).
💁 Possible Solution
I'm at a complete loss. I've never experienced this with other parcel-based typescript projects.
🔦 Context
I'm working on porting and TypeScript-ifying a large JavaScript library intended for the browser. I reached a point where I felt like it was ready to put through it's paces, but then hit this hurdle.
💻 Code Sample
I tried to pare this down to something that I could share or even narrow down the culprit. I tried deleting large hunks of code and building. Eventually I did get it to work. But then when clearing
.parcel-cache
anddist
subsequent builds didn't work. So there seems to be some state at play other than just "what do the files look like on disk" that I've been unable to pin down.Since I can't provide the environment, I want to at least describe the stateful behavior I'm seeing...
.parcel-cache
anddist
yarn parcel test-index.html
yarn parcel test-index.html
CTRL+C
yarn parcel test-index.html
CTRL+C
.parcel-cache
anddist
yarn parcel test-index.html
That's probably much more info than is truly useful...
🌍 Your Environment
The text was updated successfully, but these errors were encountered: