When using Nutrient Web SDK 1.9+ with certain build configurations, you encounter this runtime error:

ReferenceError: _Symbol$iterator4 is not defined

Cause

Your build tool’s polyfill transformations (Babel/core-js) conflict with the SDK’s internal code.

Solution

Update core-js and import polyfills explicitly before loading the SDK:

Terminal window
npm install core-js@^3.47.0 regenerator-runtime

At the top of your entry file (index.js, main.ts, or App.jsx):

// These must be the first imports
import "core-js/stable";
import "regenerator-runtime/runtime";
import NutrientViewer from "pspdfkit";
NutrientViewer.load({
container: "#pspdfkit",
document: "document.pdf",
}).then((instance) => {
console.log("Nutrient loaded", instance);
}).catch((error) => {
console.error("Failed to load:", error.message);
});

If using Babel, configure babel.config.js:

module.exports = {
presets: [
[
"@babel/preset-env",
{
useBuiltIns: "entry",
corejs: "3.47",
},
],
],
};

Alternative: Exclude SDK from transpilation

Webpack

webpack.config.js
module.exports = {
module: {
rules: [
{
test: /\.js$/,
exclude: [/node_modules/, /pspdfkit/],
use: "babel-loader",
},
],
},
};

Vite

vite.config.js
export default {
optimizeDeps: {
exclude: ["pspdfkit"],
},
};

Still not working?

  1. Check for multiple core-js versions:

    Terminal window
    npm ls core-js
  2. Clean install:

    Terminal window
    rm -rf node_modules package-lock.json
    npm install
  3. Test with a Nutrient catalog example to isolate environment issues.

  4. Contact Support with your SDK version, package.json, and bundler config.

Limitations

  • Verified on Web SDK 1.9.1. Other versions not yet tested.
  • Framework-specific integrations (Next.js, Nuxt, Angular CLI) require additional configuration.