-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Parcel reporting errors for an ES6 import that was already fixed #9246
Comments
#8723 fits the merge date and also your description of the bug |
Can we assume that this caching bug only impacts cached errors? Or is there a risk of it impacting the output of successful builds? I'm only asking so we know whether to re-enable Parcel's caching mechanism. Thanks for all the work on Parcel. |
I've updated the sample repository to use Parcel 2.10.3. The bug still occurs there. |
I've updated the sample repository to use Parcel 2.11.0 now. The bug still occurs there. |
I've updated the sample repository to use Parcel 2.12.0. The bug still occurs there. |
I've updated the sample repository to use Parcel 2.13.0. The bug still occurs there but required longer repro steps. We now need to alternate back and forth between "correct" and "incorrect" code a couple of times to trigger the bug. |
🐛 bug report
parcel build
is finding an error with an ES6import
statement, but after we fix theimport
statement the error continues to be reported. Parcel is even quoting the corrected line with the old error message.This issue was discovered on an internal company project but we've produced a minimal test case (link below).
🎛 Configuration (.babelrc, package.json, cli command)
package.json
bug.sh
A longer version of this script is in the provided repo, but this shorter one may help describe the issue.
🤔 Expected Behavior
If we attempt to import something from the wrong file or module,
parcel build
is correctly flagging it. However, after we fixed the import line, we expected thatparcel build
would no longer flag that as an error.For example, we had something like
import { Thing } from './file.js'
when it should have beenimport { Thing } from 'some-module'
. After we fixed the import we expected thatparcel build
would no longer flag that import line.😯 Current Behavior
Parcel continues to flag the fixed import line as an error. It even quotes the fixed line while reporting the original error. In the sample below, Parcel is complaining that
src/other.js does not export
a function, but then quotes the fixed source code where we are now importing fromlodash-es
.💁 Possible Solution
Removing
.parcel-cache
, disabling the Parcel cache, or touchingpackage.json
all seem to workaround the issue. These are not proper fixes though.Testing suggests that the issue does not occur in 2.0.0-nightly.1265 (2023-03-25) but does occur in 2.0.0-nightly.1271 (2023-03-27), and it does occur in all 2.9.0 - 2.9.3 releases. Presumably the issue was introduced in some commit between 2023-03-25 and 2023-03-27.
🔦 Context
We have disabled the Parcel caching mechanism for now, which increases load on our CI system. We have a large-ish monorepo, so we would really likely to re-enable Parcel's caching.
💻 Code Sample
https://github.com/paharvey/parcel-cache-bug/
🌍 Your Environment
We have replicated this on multiple systems, include Linux, Windows, and MacOS. We tend to use Yarn internally but the minimal test case provided above uses npm. Replication does seem to require Parcel 2.9.0 - 2.9.3 (more accurately, Parcel 2 from 2023-03-27 onwards).
The following are specific versions from a Linux system.
The text was updated successfully, but these errors were encountered: