TS2307 means TypeScript cannot resolve the exact module named in the import; it does not, by itself, identify the cause. Copy the full diagnostic and check its quoted module specifier first. A missing LangChain loader subpath, an unavailable puppeteer dependency, and a TypeScript resolution-mode mismatch need different fixes.
1. Read the full TS2307 diagnostic
TypeScript’s error says it cannot find a named module “or its corresponding type declarations.” The TypeScript documentation uses the sentence “Cannot find module ‘./settings.json’ or its corresponding type declarations” as an example involving JSON imports and resolveJsonModule; that example does not identify the cause of a LangChain loader error. TypeScript: resolveJsonModule
Record the exact text between the quotation marks. For example, an error naming a @langchain/community/... path points you toward the LangChain package entry or subpath; one naming puppeteer points toward that dependency. An error naming an internal dependency is a separate branch.
- Save the complete diagnostic, not only “TS2307.”
- Note which package manager, workspace, and command ran the typecheck or build.
- Check the installed versions of
@langchain/community,@langchain/core, andlangchain, plus the relevanttsconfigsettings. - Identify the execution host: modern Node.js, a bundler, or another resolver.
2. Verify the loader import against your installed release
The current LangChain JavaScript API reference documents PuppeteerWebBaseLoader in the web Puppeteer document-loader area. Its load() method returns LangChain Document objects. The reference search showed version 1.1.27 as latest at the time it was retrieved; use the reference and package contents for your installed release rather than assuming every release has the same exports. LangChain Puppeteer loader API reference
Recommended Free Tools
#1 Best Overall
The published @langchain/community 1.1.4 declaration at dist/document_loaders/web/puppeteer.d.ts imports Document and loader interfaces from @langchain/core, and browser types and functions from puppeteer. It declares PuppeteerWebBaseLoader methods including scrape(), load(), screenshot(), and imports(). This verifies that declaration for 1.1.4, not every version’s export layout. @langchain/community 1.1.4 Puppeteer declaration
- Open the documentation or package entry for the version actually installed in the application that fails.
- Confirm that the import path and named export exist in that version. Do not copy a subpath from an older tutorial without checking it.
- Check the package’s declarations and export metadata if the documented class exists but TypeScript cannot resolve the subpath.
3. Make sure the dependency is installed in the typechecking workspace
For a missing LangChain loader module, confirm that @langchain/community is installed where the application is being typechecked—not merely in a different package in a monorepo. LangChain’s package guidance names @langchain/community in its installation instructions and recommends keeping a common @langchain/core version aligned when multiple LangChain packages are used. LangChain installation guidance
Rank #2
If the quoted specifier is puppeteer, check that Puppeteer is installed and visible to the importing workspace. The published community declaration directly imports Puppeteer types, so that is distinct from a missing @langchain/community loader subpath.
4. Match TypeScript resolution to the host
The TypeScript moduleResolution setting determines how import specifiers are resolved. Its guidance distinguishes modern Node modes, node16 and nodenext, from bundler; select the mode that matches the project’s actual runtime or bundler. TypeScript module-resolution reference
Do these 3 things before closing this tab:
1Clear out junk files and repair common Windows errors2Fix the driver behind crashes, sound loss and screen glitches3Repair Windows errors before they cause bigger problems- For a modern Node.js project, use the appropriate modern Node resolution mode for the project’s module setup.
- For a project whose imports are handled by a bundler, use the bundler mode where applicable.
- Check both
moduleandmoduleResolutionin the configuration used by the failing build; an editor may be using a different project configuration. - Do not add a
pathsalias merely to silence the diagnostic. TypeScript warns thatpathscan override package metadata such asexports, leaving a specifier that typechecks but fails at runtime.
Package subpaths and exports affect which imports are available. A specifier that worked with another release or resolution mode may not resolve in this project. Inspect the installed package’s entry points instead of assuming a compiler setting can make an absent subpath real.
5. Separate type-resolution errors from browser and export failures
The import fails during typecheck
Return to the quoted specifier: establish whether it names the LangChain loader path, puppeteer, or another dependency. Then verify installation, release-specific declarations, package exports, workspace visibility, and resolution mode in that order.
Rank #4
The import resolves, but Puppeteer cannot launch a browser
That is a runtime installation or operating-system dependency issue, not the same as TS2307 for a loader import. Puppeteer notes that some package managers block install scripts; if a browser download is needed, its troubleshooting guide offers npx puppeteer browsers install. Follow the guide for the specific launch error and environment. Puppeteer troubleshooting
The error names puppeteer-core/internal/… or a framework says an export is missing
Puppeteer documents an internal puppeteer-core/internal/... missing-module failure that can occur with Node versions below 14 or a custom resolver such as jest-resolve; its guidance is to use a supported Node version or update the resolver. That is not the LangChain loader-subpath problem. Puppeteer troubleshooting
Best Value
- Used Book in Good Condition
Likewise, a framework build error saying a LangChain class is not exported is not automatically TS2307. LangChain.js issue #8441, opened July 1, 2025, describes a separate BaseDocumentLoader export error in a filesystem-loader context using @langchain/community 0.3.47, @langchain/core 0.3.61, langchain 0.3.29, Node 22.12.0, and Next.js 15.3.4. It is a version-specific report, not a general fix recipe for Puppeteer imports. LangChain.js issue #8441
Or skip the browser setup
If your goal is to capture a page rather than load it into LangChain as a document, ScreenshotNeo offers a screenshot API and MCP server. It is not a replacement for PuppeteerWebBaseLoader when you need LangChain Document objects. A single GET request returns an image or PDF; see the ScreenshotNeo API documentation.
cURL example, with the target URL adapted to the page you need:
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
Cookie banners are accepted and removed before capture, along with supported newsletter popups and chat widgets. Bot checks, blank pages, failed loads, timeouts, and cache hits are not billed, and the response identifies the page verdict and billing status in headers. Its MCP server provides take_screenshot, get_page_info, and capture_pdf tools for AI agents. The Free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000.
Windows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallOutdated 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 matchSign up free for 1,000 screenshots a month, with no card required.
What to collect if it still fails
A useful diagnosis needs the full diagnostic and enough project context to reproduce TypeScript’s resolution decision. Share or inspect:
Quick Recap
- The complete TS2307 line, including its exact quoted module name.
- Installed versions of the LangChain packages and Puppeteer, and the package manager’s workspace in which they are installed.
- The import statement, relevant
package.jsondependencies, and themodule/moduleResolutionsettings from the configuration used by the failing command. - Whether the failure occurs in editor diagnostics, a TypeScript command, a framework build, or only when launching the browser.
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.

