Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

126
Views
CDN not adding methods/properties to window object when trying to use iFrameResizer

I am trying to use the iFrameResizer package on a parent site and embed a basic react page via an iframe. To the parents site's index.html I've added the following code:

<iframe frameborder="0" id="sizetracker" src="http://localhost:3001" width="100%"
    style="position: fixed; z-index: 1000; bottom: 0; right: 0"></iframe>
<script src="https://cdn.jsdelivr.net/npm/iframe-resizer@4.2.11/index.min.js"></script>
<script>
    window.iFrameResize({ log: true }, '#sizetracker') // error thrown here
</script>

I'm using a cdn to add the package. I've tried the CDN from unpkg (via https://unpkg.com/iframe-resizer@4.3.2/index.js) as well as the url in the src attribute above that I got from js-delivr.

Two errors are thrown:

  1. Uncaught ReferenceError: module is not defined - this seems to be coming from the CDN's index.js
  2. Uncaught TypeError: window.iFrameResize is not a function - I'm guessing this is because of the above failed error.

How can I correctly import via CDN and then use that npm package in script tags in my html?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

CDN Link was pointing to the wrong JS file. Don't use the one from jsdelivr or direct from unpkg. Instead use: https://cdn.jsdelivr.net/npm/iframe-resizer@4.2.11/js/iframeResizer.min.js

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!