What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.
“chromium.executablePath is not a function” means your code is calling a property as though it were a function. The correct syntax depends on the installed @sparticuz/chromium release: newer releases expose executablePath(location?), while older releases expose executablePath as a promise-valued getter. First verify the version that is actually deployed, then make your code, CDK bundling strategy, Lambda layer, and CPU architecture agree.
1. Identify which executablePath API your package exports
There are two incompatible call shapes in released versions of @sparticuz/chromium. Current documentation defines executablePath(location?: string) and returns a Promise<string>. Older releases used a getter that already returned a promise. Parentheses are therefore correct for one release and produce the error for the other.
| Installed API | Correct expression | What goes wrong if you use the other form |
|---|---|---|
| Function-style release | const executablePath = await chromium.executablePath(); |
Without parentheses you receive the function itself rather than a resolved path. |
| Getter-style release | const executablePath = await chromium.executablePath; |
With parentheses Node reports “is not a function”. |
Check the version used at runtime
- Run
npm ls @sparticuz/chromiumfrom the application directory. - Inspect the resolved entry in
package-lock.json(or your equivalent lockfile). - Check the Lambda asset or layer, not only your workstation. A stale layer or duplicate bundled copy can expose a different release than local source.
- Open that release’s README and TypeScript declarations. They are the authoritative indication of whether
executablePathis callable.
If esbuild has wrapped the module, inspect the generated bundle’s export shape as well. CommonJS/ES module interop can make an apparently correct import resolve to a wrapper object, and a stale deployment can preserve an old API after the dependency was upgraded.
Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchPC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 112. Use a version-matched Puppeteer launch
Function-style API (current releases)
import chromium from '@sparticuz/chromium';
import puppeteer from 'puppeteer-core';
export const handler = async () => {
const executablePath = await chromium.executablePath();
const browser = await puppeteer.launch({
args: chromium.args,
defaultViewport: chromium.defaultViewport,
executablePath,
headless: chromium.headless,
});
try {
const page = await browser.newPage();
await page.goto('https://example.com', { waitUntil: 'networkidle0' });
return { statusCode: 200, body: await page.title() };
} finally {
await browser.close();
}
};
Getter-style API (older releases)
import chromium from '@sparticuz/chromium';
import puppeteer from 'puppeteer-core';
export const handler = async () => {
const executablePath = await chromium.executablePath;
const browser = await puppeteer.launch({
args: chromium.args,
defaultViewport: chromium.defaultViewport,
executablePath,
headless: chromium.headless,
});
try {
const page = await browser.newPage();
await page.goto('https://example.com', { waitUntil: 'networkidle0' });
return { statusCode: 200, body: await page.title() };
} finally {
await browser.close();
}
};
Do not “fix” the error by trying both forms at runtime without understanding the package. A compatibility shim can hide a bad deployment and make future upgrades difficult. Pin the dependency, choose the syntax documented by that pinned release, and redeploy the lockfile and asset together.
#1 Best Overall
- Includes Raspberry Pi 5 with 2.4Ghz 64-bit quad-core CPU (8GB RAM)
- Includes 128GB Micro SD Card pre-loaded with 64-bit Raspberry Pi OS, USB MicroSD Card Reader
- CanaKit Turbine Black Case for the Raspberry Pi 5
- CanaKit Low Noise Bearing System Fan
- Mega Heat Sink - Black Anodized
3. Choose one CDK packaging model
AWS CDK NodejsFunction bundles referenced modules with esbuild by default. Chromium can either be included in that function bundle or supplied by a Lambda Layer. Mixing the two accidentally is a frequent cause of path and version failures.
| Decision | Bundle with function | Provide with a layer |
|---|---|---|
| CDK setting | Do not list @sparticuz/chromium in externalModules. |
Set externalModules: ['@sparticuz/chromium']. |
| Where files live | Inside the function asset produced by esbuild/CDK. | nodejs/node_modules/@sparticuz/chromium in the layer ZIP. |
| Sharing | Each function deploys its own copy. | Several functions can attach one versioned layer. |
| Version control | Dependency and code are upgraded together. | Code and layer versions must remain synchronized. |
| Local reproduction | Usually simpler because one asset contains the dependency. | Requires reproducing the layer path or installing the same package locally. |
| Cold-start behavior | Extraction and initialization occur from the function asset. | Lambda mounts the layer under /opt; Chromium may extract there or to the location you provide. |
Bundled dependency pattern
const fn = new nodejs.NodejsFunction(this, 'PdfFn', {
entry: 'src/handler.ts',
runtime: lambda.Runtime.NODEJS_20_X,
architecture: lambda.Architecture.X86_64,
bundling: {
// @sparticuz/chromium is intentionally bundled.
},
});
Keep @sparticuz/chromium in dependencies, not only devDependencies. A devDependency may be absent from the production installation used to build the Lambda asset.
Layer-supplied dependency pattern
const fn = new nodejs.NodejsFunction(this, 'PdfFn', {
entry: 'src/handler.ts',
runtime: lambda.Runtime.NODEJS_20_X,
architecture: lambda.Architecture.X86_64,
layers: [chromiumLayer],
bundling: {
externalModules: ['@sparticuz/chromium'],
},
});
The layer ZIP must contain a Lambda-compatible path such as nodejs/node_modules/@sparticuz/chromium. Lambda makes Node.js layer modules available under /opt/nodejs/node_modules. If the layer does not have that directory structure, the module may be missing even though the layer is attached.
When a custom extraction location is required
The Chromium package documentation describes passing a layer location when appropriate:
Rank #2
- Includes Raspberry Pi 4 4GB Model B with 1.5GHz 64-bit quad-core CPU (4GB RAM)
- Includes Pre-Loaded 32GB EVO+ Micro SD Card (Class 10), USB MicroSD Card Reader
- CanaKit Premium High-Gloss Raspberry Pi 4 Case with Integrated Fan Mount, CanaKit Low Noise Bearing System Fan
- CanaKit 3.5A USB-C Raspberry Pi 4 Power Supply (US Plug) with Noise Filter, Set of Heat Sinks, Display Cable - 6 foot (Supports up to 4K60p)
- CanaKit USB-C PiSwitch (On/Off Power Switch for Raspberry Pi 4)
const executablePath = await chromium.executablePath('/opt/chromium');
Use this only with a function-style release that accepts the location parameter and only when your layer actually places the Chromium files there. An error mentioning an input directory such as /var/task/bin commonly indicates that the package was not externalized correctly, the layer layout is wrong, or two copies are competing at runtime.
4. Set the Lambda architecture explicitly
The referenced @sparticuz/chromium build does not support ARM in the documented releases. An ARM64 function can therefore fail with an execution-format error even after the JavaScript API call is corrected. Set Architecture.X86_64 in CDK and deploy a matching x86_64 layer.
runtime: lambda.Runtime.NODEJS_20_X,
architecture: lambda.Architecture.X86_64,
Do not infer compatibility from your development laptop. The binary architecture, Lambda architecture, Node.js runtime, and layer build must all match.
Quick wins for a faster PC:
Scan for outdated or missing drivers - takes under a minuteDriver Scan →Clear out junk files and repair common Windows errorsFree Scan →5. Keep local browser testing separate from Lambda testing
The serverless Chromium build is headless and intended for Lambda. A local headful test can fail even when the Lambda configuration is correct. During local development, use a locally installed Chrome/Chromium or a Puppeteer-managed browser; select the Lambda binary only in the deployed branch.
Rank #3
- Not including the Raspberry Pi 5 (8GB), the Crowpi advanced version comes with the Raspberry Pi 5
- ELECROW Black Case for the Raspberry Pi 5, CrowPi is equipped with a 9-inch HD touchscreen along with a camera; All the regular components used in DIY electronics are packed into the CrowPi development board, such as LCD, LED matrix, buzzer, light sensor, PIR sensor, ultrasonic sensor, IR sensor, etc
- Raspberry Pi Sensors: The Crowpi raspberry pi 5 programming kit is jam-packed with lots of buttons such as 19 different sensors in a tidy easy to use package; You don't have to wait and wire things
- Build Quality: Solid ABS shell and well made components in one place make it strong and convenient to travel
- Programming Lessons: This raspberry pi 5 learning kit ships with step by step instructions and provides 21 lessons to take you through identifying components reading code and running it in the terminal
const isLocal = process.env.IS_LOCAL === '1';
const executablePath = isLocal
? process.env.LOCAL_CHROME_PATH
: await chromium.executablePath();
const browser = await puppeteer.launch({
args: isLocal ? [] : chromium.args,
executablePath,
headless: isLocal ? false : chromium.headless,
defaultViewport: chromium.defaultViewport,
});
Set LOCAL_CHROME_PATH to a real browser executable on the development machine. In CI, use a known installed browser or a Puppeteer-managed binary; do not assume /opt or /var/task exists outside Lambda.
6. A deployment checklist that catches most failures
- Run
npm ls @sparticuz/chromiumand record the exact version. - Confirm the README and declarations specify getter-style or function-style
executablePath. - Remove stale duplicate copies from both the function asset and any layer.
- Verify the layer contains
nodejs/node_modules/@sparticuz/chromium. - Use
externalModulesonly when the attached layer really supplies the module. - Keep the runtime package in
dependencies. - Set Lambda to
x86_64for releases without ARM support. - Log the resolved executable path once in a non-production diagnostic deployment.
- Launch Puppeteer with the same API shape your installed release exports.
7. Troubleshooting by symptom
“chromium.executablePath is not a function”
Your code uses parentheses against a getter-style release, or the import resolves to the wrong module object. Check the deployed version and export shape, then use await chromium.executablePath or upgrade and use await chromium.executablePath() consistently.
“chromium.executablePath is undefined”
The package may not be present in the asset, the import may be wrong for the module system, or a layer may be mounted without the expected Node.js directory. Inspect the bundle and layer contents and remove duplicate versions.
Input directory such as /var/task/bin
This usually points to incorrect bundler externalization or a layer-layout problem. Decide whether the package is bundled or layered, apply only that model, and verify the extraction location passed to executablePath.
Rank #4
- Fully assembled for plug-and-play operation
- Includes Raspberry Pi 5 with 8GB RAM
- 256 GB PCIe Pi NVMe SSD (Pre-loaded with Pi 64-Bit OS)
- M.2 HAT+
- CanaKit Turbine Black Case for the Pi 5
Execution-format error in Lambda
The binary and function architecture do not match. Deploy the documented package on x86_64 and rebuild the layer for that architecture.
Works locally but fails after deployment
Local code may resolve a different package version or a local Chrome binary. Compare lockfile, generated asset, layer contents, runtime, architecture, and environment variables. Log the resolved path in a diagnostic deployment.
Browser launches but pages fail or time out
That is no longer an executablePath API error. Check Lambda memory and timeout, network access, target-site bot checks, and whether the page requires additional wait conditions. Keep browser launch diagnostics separate from page-navigation diagnostics so the first failing stage is visible.
Or skip the browser setup
If your goal is simply to obtain reliable website images or PDFs rather than maintain Chromium in Lambda, ScreenshotNeo provides a single HTTP request. It accepts consent banners before capture and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each cleanup step can be disabled. Bot checks, CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers identify the page verdict and billing status. Its MCP server exposes take_screenshot, get_page_info, and capture_pdf to Claude, Cursor, and other MCP clients.
See the complete options in the ScreenshotNeo documentation. A direct cURL call is:
Best Value
- 【What you Get】You will get 1*Pi 5 8GB Single Board,1*RasTech Case,1*Active Cooler,1*Screwdriver,1*Installation instructions,12-month free warranty, lifetime service, 24-hour prompt and friendly response.
- 【More Connectors】There are two USB 3.0 ports(5Gbps simultaneously) and two USB 2.0 ports, which triple total bandwidth ,support any combination of up to two cameras or displays. Peak SD card performance is doubled through support for the SDR104 high-speed mode. It provides a smooth desktop experience for you. Offer Gigabit Ethernet and a PCIe interface, along with dual-band Wi-Fi and Bluetooth 5.0/BLE wireless capability. The RasTech Pi 5 Kit use the new 27W 5.1V 5A USB-C power connector.
- 【 Support Dual 4Kp60 Display 】Each of the two microHDMI sockets can control a 4K display at 60 Hertz, now support HDR, offering super HD video for media streaming projects. RPi 5 is the first RPi model that comes with a PCI Express port (PCIe 2.0 x1 with 500 MB/s) to attach SSDs (requires separate M.2 HAT).
- 【 Excellent Chips And Applications】Pi 5 is a full-size Pi computer using silicon built in-house at Pi. The RP1 “southbridge” provides the bulk of the I/O capabilities for Pi 5. Pi 5 is more friendly and convenient in the development of Internet of Things, Web development, machine identification, automatic control and other electronic equipment applications and network.
- 【 Faster CPU, Better GPU 】 Pi 5 features a Broadcom BCM2712 64-bit quad-core Arm Cortex-A76 processor running at 2.4GHz, it delivers a 2–3× increase in CPU performance relative to RaspberryPi 4. The 800MHz VideoCore VII GPU is compatible to OpenGL ES 3.1 and Vulkan 1.2, substantial uplift in graphics performance. Pi 5 Offers lightning-fast CPU speed, a PCI Express interface, a Real Time Clock (RTC) and a power button and runs significantly cooler than Pi 4.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
The same request in Python:
import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)
And Node.js:
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
Every plan includes the full feature set: full-page and selector captures, device presets or custom viewports, dark mode, retina scale, PDF controls, custom CSS and JavaScript, clicks, waits, request blocking, headers, cookies, user agents, authorization, timezone, geolocation, transparent backgrounds, resizing, chosen cache TTLs, signed links, asynchronous webhooks, bulk capture of up to 100 URLs per call, a usage API, and an OpenAPI specification. The free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000.
Create a free ScreenshotNeo account and get 1,000 screenshots a month without entering a card.
Recommended Free Tools
Frequently asked questions
Can one codebase support both API styles?
Yes, but only with an explicit compatibility decision based on the resolved package version. Pin the version and test the exact deployed asset rather than guessing from local source.
Should I use puppeteer or puppeteer-core?
Use the browser package that matches your deployment design. When @sparticuz/chromium supplies the executable, puppeteer-core is commonly used so a second browser download is not included accidentally.
Is a Lambda layer always smaller?
Not necessarily. A layer can be shared across functions, but it still has its own size, versioning, extraction, and synchronization costs. Measure the produced assets and choose the model your deployment pipeline can reproduce reliably.
Frequently Asked Questions
Can I fix the error by adding parentheses everywhere?
No. Parentheses are correct only for releases that export function-style executablePath(location?); getter-style releases require await chromium.executablePath.
The Tool Desk
Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Why does changing CDK code not change the Lambda behavior?
A stale layer, cached asset, or duplicate bundled copy may still be deployed. Inspect the generated function and layer contents and redeploy the intended version together.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

