WordPress.org

Make WordPress Core

Opened 3 years ago

Last modified 6 months ago

#46110 assigned defect (bug)

IE11: JS "Syntax error" related to wp-polyfill-formdata

Reported by: afercia Owned by: atimmer
Milestone: Future Release Priority: normal
Severity: normal Version: 5.0
Component: Build/Test Tools Keywords: has-screenshots has-patch
Focuses: javascript Cc:

Description

In Internet Explorer 11, there's a JavaScript "Syntax error" related to wp-polyfill-formdata. The error happens in various pages, e.g. in edit.php and post.php.

http://cldup.com/-UPS1EV0FC.png

IE11 doesn't support "arrow functions" and other ES6 features in that file. Asked for feedback on Slack #core-editor and it was pointed out that seems core is using the wrong file from the package.

Wrong version used in core:

https://github.com/WordPress/wordpress-develop/blob/e01f30a/tools/webpack/packages.js#L104

Correct version used in the Gutenberg plugin:

https://github.com/WordPress/gutenberg/blob/2d7035b/lib/client-assets.php#L619

Introduced in [43719] /Cc @omarreiss @atimmer

Attachments (1)

46110.diff (606 bytes) - added by mariyan96 21 months ago.

Download all attachments as: .zip

Change History (25)

#1 @ocean90
3 years ago

  • Component changed from General to Build/Test Tools
  • Keywords needs-patch added
  • Milestone changed from Awaiting Review to 5.1.1

The file is only loaded if SCRIPT_DEBUG is set.

We could ask the author to include a formdata.js in a /dist directory. They are using the Closure Compiler so the WHITESPACE_ONLY option would fit for this.

#2 @atimmer
3 years ago

I've asked the author of the library to include a non-minified build file: https://github.com/jimmywarting/FormData/issues/69.

I see two possible workarounds:

  • Build the file ourselves in the webpack configuration.
  • Ship the minified file as the non-minified file.

The second one is easier to implement, the first one is better.

#3 @netweb
2 years ago

  • Owner set to atimmer
  • Status changed from new to assigned

This ticket was mentioned in Slack in #core by lukecarbis. View the logs.


2 years ago

#5 @lukecarbis
2 years ago

  • Milestone changed from 5.1.1 to 5.2

#6 @jorbin
2 years ago

  • Milestone changed from 5.2 to 5.3

Bumping due to lack of activity upstream.

#7 @afercia
2 years ago

Noting the upstream issue on GitHub has been automatically closed by the "stale bot" because of lack of activity and seems the project maintainers aren't inclined to ship a non-minified version.

This ticket was mentioned in Slack in #core by david.baumwald. View the logs.


22 months ago

#9 @netweb
22 months ago

  • Milestone changed from 5.3 to 5.4

Due to lack of updates, punting this to 5.4 to clear the way for 5.3

@mariyan96
21 months ago

#10 @mariyan96
21 months ago

  • Keywords has-patch added; needs-patch removed

Hey guys,

We were on WordPress Contributors Day (Sofia, Bulgaria) and this is my first ticket.

The changes consist of loading the minified assets which are going through Grunt. This should solve a lot of other compatibility issues as well. Attaching 46110.diff​ file with my changes.

#11 @aduth
18 months ago

Noting that the patch provided for #49423 may incidentally resolve this.

This ticket was mentioned in Slack in #core by mike. View the logs.


17 months ago

This ticket was mentioned in Slack in #core by david.baumwald. View the logs.


17 months ago

#14 @aduth
17 months ago

46110.diff may work, but only because it bypasses SCRIPT_DEBUG to force the minified script of all vendor scripts to always be loaded. While this resolves the issue of this ticket, in doing so it breaks expectations that SCRIPT_DEBUG load unminified files.

Related: https://wordpress.org/support/article/debugging-in-wordpress/#script_debug

#15 @jorgefilipecosta
17 months ago

  • Milestone changed from 5.4 to 5.5

This ticket was mentioned in Slack in #core-editor by aduth. View the logs.


16 months ago

This ticket was mentioned in Slack in #core by david.baumwald. View the logs.


13 months ago

#18 @davidbaumwald
12 months ago

@jorgefilipecosta, @aduth Is this still on your list to handle in 5.5

This ticket was mentioned in Slack in #core by david.baumwald. View the logs.


12 months ago

#20 @SergeyBiryukov
12 months ago

  • Milestone changed from 5.5 to 5.6

Per comment:14, it looks like there's still no consensus on the correct approach.

Since it was noted that #49423 might fix this, and it's already moved to 5.6, moving this ticket too along with it.

Last edited 12 months ago by SergeyBiryukov (previous) (diff)

#21 @hellofromTonya
9 months ago

  • Milestone changed from 5.6 to 5.7

#49423 has been moved 5.7.

As Sergey's noted:

Since it was noted that #49423 might fix this, and it's already moved to 5.6, moving this ticket too along with it.

Moving this ticket to 5.7 too.

#22 @webaware
7 months ago

Worth mentioning that this also impacts theme development. I have to disable SCRIPT_DEBUG so that I can test some code on IE11, which is... suboptimal. I'll have to forcibly override loading the unminified script when SCRIPT_DEBUG is set, so that I can properly test / debug theme code on IE11.

This ticket was mentioned in Slack in #core by hellofromtonya. View the logs.


6 months ago

#24 @hellofromTonya
6 months ago

  • Milestone changed from 5.7 to Future Release

As previously noted, the fix for this issue may be resolved by #49423. 49423 was punted to Future Release. Moving this ticket to future also.

Note: See TracTickets for help on using tickets.