webstaff reporter: auto-resize no longer happens
Bug #1753008 reported by
Galen Charlton
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Evergreen |
Fix Released
|
Medium
|
Unassigned |
Bug Description
When opening the reports page in the web staff client for 3.1-beta/master, the iframe fails to automatically resize to fit the length of the embedded page and the following error is logged in the Javascript console:
eframe.js:104 Uncaught ReferenceError: iFrameResize is not defined
at h.$scope.
at HTMLIFrameEleme
at HTMLIFrameEleme
at HTMLIFrameEleme
Initial testing and comparison with rel_3_0 strongly suggests that issue was introduced by the change to Webpack and the bundling of iframe-resizer into the vendor bundle.
Evergreen master/3.1
Changed in evergreen: | |
milestone: | none → 3.1-rc |
importance: | Undecided → Medium |
Changed in evergreen: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
I noticed this as well, and can confirm it is Webpack related. To repeat what was said on IRC, Webpack messes with the iframeResizer.js file, and this causes the iFrameResize function to not be created on 'window'. Maybe this is part of what Webpack is supposed to do, but we somehow aren't using the whole stack quite right, or this package isn't quite compatible with Webpack when used this way.
More specifically, I see these lines near the end of that js:
if (typeof define === 'function' && define.amd) { [],factory) ;
define(
become:
if (true) { WEBPACK_ AMD_DEFINE_ ARRAY__ = [], __WEBPACK_ AMD_DEFINE_ FACTORY_ _ = (factory),...
!(__
Ultimately, due to 'if (true)', we do not get the later 'else' branch which creates the global (window) function.
I am not sure what the overall requirements are to successfully bundle packages, but the shortest path to working probably involves not packing this module (as we do for a couple others).