When attempting to run `npm run build` in a project that integrates Nutrient Web SDK, you may encounter a `TypeError` related to the `split()` function in `pspdfkit.js` or `nutrient-viewer.js`. This is usually triggered during the production build phase with `react-scripts`.

The error message will look like this:

```

TypeError:.../node_modules/pspdfkit/dist/pspdfkit.js: Cannot read properties of undefined (reading 'split')

```

Or, alternatively, like this:

```

TypeError:.../node_modules/nutrient-sdk/viewer/dist/nutrient-viewer.js: Cannot read properties of undefined (reading 'split')

```

## Root cause

This error is commonly caused when the SDK or the surrounding project environment attempts to operate on an undefined value during the build process. For example, the SDK may be expecting a configuration string like a URL or a path, but it wasn’t provided, so it received `undefined` instead.

Additional signs you may observe:

- A warning about `caniuse-lite` being outdated

- Use of an outdated SDK version

- Compatibility issues between Node.js, TypeScript, and the SDK

## Resolution steps

To fix this error and complete the build successfully, follow the steps below.

### 1. Check for undefined values

Examine the configuration or integration points to ensure you’re providing all the required parameters. Additionally, inspect the places where you may be passing a `null` or `undefined` value, especially any of the following:

- `document` URL or file path

- Container ID or element

- Options passed to `NutrientViewer.load()`

Doublecheck any dynamic variables passed into the SDK. Ensure they’re properly initialized and that they’re valid strings.

### 2. Update to the latest SDK

Ensure you’re using the most up-to-date Web SDK version.

### 3. Rebuild the project

After making the changes above, run the build again:

```bash

npm run build

```

## Isolate the issue

If you’re still running into the error after trying all steps above, test the integration inside one of [our out-of-the-box examples](https://www.nutrient.io/guides/web/downloads.md) to rule out environment-specific issues.
---

## Related pages

- [Bug Reporting](/guides/web/troubleshooting/bug-reporting.md)
- [Chunkloaderror During Pspdfkit To Nutrient Migration In Ember](/guides/web/troubleshooting/chunkloaderror-during-pspdfkit-to-nutrient-migration-in-ember.md)
- [Testing Troubleshooting](/guides/web/troubleshooting/testing-troubleshooting.md)
- [npm](/guides/web/troubleshooting/nightlies.md)
- [Fixing Symbol Iterator Error](/guides/web/troubleshooting/fixing-symbol-iterator-error.md)
- [This will make the current directory contents available through `http://0.0.0.0:5000`.](/guides/web/troubleshooting/common-issues.md)
- [Typescript](/guides/web/troubleshooting/miscellaneous/typescript.md)
- [Webassembly Simd Support](/guides/web/troubleshooting/webassembly-simd-support.md)

