-
-
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 2 - Bundle codegen contains non-ie11 compatible code - but only in watch mode #6676
Comments
I've been looking at this issue again today. Today I looked over this closed issue #6502 which lists very similar issues I'm seeing in IE11 with trailing commas. Looks like the fixes were merged in as part of #6532 Today I've tried a clean install of 2.0.0-rc.0 instead of 2.0.0-beta.3.1. The trailing commas I was seeing are now gone as part of the PR fix, but I'm still getting issues with non IE11 compatible code generated by Parcel when running a prod build. In the polyfill bundle: Config is as follows: package.json
I removed the babel config file as I'm just using default settings and browser targets specified above. Would really appreciate any input on this - thank you 🙏 |
I'm having similar problems with IE11 using Parcel 2.0.0-rc.0. I don't use a I simply have the following in my
And my start command executes Transpiled |
I get something like that in your case: parcelHelpers.export(exports, "x", function() {
return x;
}); |
Hi @mischnic I'm trying to create a simple test case where I can reproduce the issue and share the repo. In the meantime, in my work/private repo, I've re-installed Parcel V2 RC0 again and I'm still seeing the same issues. For components/modules that I've created (e.g. an accordion), the transpiled code is OK:
But for other code (which I'm assuming are to do with various polyfills I've added), I still get arrow functions with the parcel start command. For example:
|
So code imported from Caused by this
|
I now have a public repo where I can reproduce my issues with non-transpiled arrow functions. The repo is a simplification of everything I need for our production setup at work (i.e. Sass & PostCSS, TypeScript& ES6+, differential bundling, dynamically imported polyfills, linters & prettier).
Hopefully this will help you. :) |
I was able to reproduce this with just import {add} from "lodash-es";
console.log(add(1,2)); Then all modules from |
Hi @mischnic - is there any update on this? |
Not sure if my problem is actually related or not, but I'm currently struggling to update a Node (14) app from _parcelHelpers.export(exports, "Badge", function () {
return Badge;
});
[...]
let Badge = class Badge extends _BaseEntity.BaseEntity {
[...] With parcelHelpers.export(exports, "Badge", ()=>Badge2
) //# sourceMappingURL=Badge.js.map
;
[...]
let Badge2 = class Badge1 extends _baseEntity.BaseEntity {
[...] The latter doesn't work due to the scoping difference of arrow functions, leading to |
Hi @mischnic, Can I ask for some clarity on this issue? Is it related to PR 7293 raised by @thewilkybarkid ? I'm keeping my fingers crossed that the PR will fix it! ;) |
No, the problem here is that the targets are only forwarded to the Rust side for source assets.
with the original intention that preset_env shouldn't apply for non-source assets: parcel/packages/transformers/js/core/src/lib.rs Lines 306 to 312 in 8cabeae
These
So the solution here would be to basically always forward the targets and move that Though #7345 (comment) would just remove that whole |
We're having the exact same issue when running the parcel (v2.5.0) dev server as this comment #6676 (comment). We've tried multiple work arounds but the I've followed threads around this repo which seem to indicate this being fixed, then others stating it's not. Can anyone shed some light e.g. maintainers as to what the actual status is as this seems very easy to reproduce and there's a lot of noise surrounding Parcel 2 and similar issues? |
This can indeed still happens when scope hoisting isn't used (so also @newtriks In which code do you still see arrow functions like these? (And also: is there any other IE-incompatible code you're getting?)
AFAICT, this only happens for everything inside files from the |
🐛 Bug
I have a project with multiple bundles using Parcel 1. We bundle on a component level so there's quite a few as you can imagine. I've tried upgrading to Parcel 2 this week but I can't seem to get IE11 working using Parcel 2's watch mode - but the build option is working fine.
🔦 Context
We use an IE11 polyfill bundle that we conditionally serve only in IE11. We don't use targets or anything fancy to serve this, its literally just added into the HTML (example below).
If I run a prod build - everything appears to work fine. But if I try to run the local dev watch task, IE throws a syntax error for all of the bundle files because there appears to still be non-compatible IE11 code present in the bundle.
💻 Examples
package.json
babel.config.json
ie11-polyfill.js
This is what we get for every bundle file in IE11 when running watch mode:
As I said before, running a prod build works fine.
Thanks in advance for taking a look, Parcel has been fantastic for us and we hope to continue with it in future.
The text was updated successfully, but these errors were encountered: