Installation Troubleshooting
Having issues getting 3Lens installed or running? This guide covers the most common problems and their solutions.
Installation Issues
Package Not Found
Error: npm ERR! 404 Not Found - GET https://registry.npmjs.org/@3lens/core
Solutions:
- Check that you're using the correct package name (note the
@scope) - Ensure you have network connectivity to npm
- Try clearing your npm cache:bash
npm cache clean --force1 - If using a private registry, ensure it's configured to fall back to the public npm registry
Peer Dependency Warnings
Warning: npm WARN peerDependencies: three@^0.150.0 is required
Solutions:
- Install the recommended three.js version:bash
npm install three@latest1 - If you need an older version, 3Lens supports three.js 0.140.0+, though some features may be limited
TypeScript Errors on Install
Error: Cannot find module '@3lens/core' or its corresponding type declarations
Solutions:
- Ensure TypeScript is configured to find node_modules:json
// tsconfig.json { "compilerOptions": { "moduleResolution": "bundler", // or "node" "esModuleInterop": true } }1
2
3
4
5
6
7 - Restart your TypeScript server (in VS Code:
Cmd+Shift+P→ "TypeScript: Restart TS Server")
ESM/CJS Module Issues
Error: ERR_REQUIRE_ESM: require() of ES Module not supported
3Lens is distributed as ESM. If you're using CommonJS:
Solution 1: Use dynamic import:
async function setupDevtools() {
const { createProbe } = await import('@3lens/core');
const { bootstrapOverlay } = await import('@3lens/overlay');
// ...
}2
3
4
5
Solution 2: Update your project to ESM:
// package.json
{
"type": "module"
}2
3
4
Runtime Issues
Overlay Not Appearing
Symptom: No UI appears after calling bootstrapOverlay()
Checklist:
✅ Verify the probe is created and connected:
typescriptconst probe = createProbe({ debug: true }); // Enable debug logging console.log('Probe created:', probe); probe.observeRenderer(renderer); probe.observeScene(scene); bootstrapOverlay(probe);1
2
3
4
5
6✅ Check the browser console for errors
✅ Ensure
bootstrapOverlayis called after the DOM is ready:typescript// If using before DOMContentLoaded, wrap in event listener document.addEventListener('DOMContentLoaded', () => { bootstrapOverlay(probe); });1
2
3
4✅ Try pressing
Ctrl+Shift+D(orCmd+Shift+Don Mac) - the overlay might be hidden✅ Check if the overlay container exists:
javascriptconsole.log(document.querySelector('#threelens-overlay'));1✅ Verify no CSS is hiding the overlay:
css/* Check for conflicting styles */ #threelens-overlay { display: block !important; visibility: visible !important; }1
2
3
4
5
"Cannot read property 'observeRenderer' of undefined"
Cause: The probe wasn't created or createProbe() failed.
Solution:
import { createProbe } from '@3lens/core';
// Make sure createProbe is actually called
const probe = createProbe();
if (!probe) {
console.error('Failed to create probe');
} else {
probe.observeRenderer(renderer);
}2
3
4
5
6
7
8
9
10
No Stats Appearing (0 FPS, 0 Draw Calls)
Cause: The probe isn't connected to your render loop.
Solutions:
Ensure
observeRenderer()is called BEFORE your render loop starts:typescriptprobe.observeRenderer(renderer); probe.observeScene(scene); // THEN start the render loop function animate() { requestAnimationFrame(animate); renderer.render(scene, camera); } animate();1
2
3
4
5
6
7
8
9Verify the renderer is the same instance:
typescript// ❌ Wrong: Creating new renderer after observation probe.observeRenderer(renderer); renderer = new THREE.WebGLRenderer(); // New instance! // ✅ Correct: Use same instance const renderer = new THREE.WebGLRenderer(); probe.observeRenderer(renderer); // Use this same renderer throughout1
2
3
4
5
6
7
8Check that
renderer.render()is actually being called
Selection Not Working (Inspect Mode)
Cause: Missing THREE reference or scene not observed.
Solutions:
Provide the THREE namespace:
typescriptimport * as THREE from 'three'; probe.setThreeReference(THREE);1
2
3Ensure all scenes are observed:
typescriptprobe.observeScene(mainScene); probe.observeScene(uiScene); // Don't forget secondary scenes!1
2Check that objects are actually in the scene:
javascriptconsole.log('Scene children:', scene.children.length);1
Framework-Specific Issues
React / React Three Fiber
Issue: "useThreeLens must be used within ThreeLensProvider"
Solution:
// Wrap your app or canvas in the provider
import { ThreeLensProvider } from '@3lens/react-bridge';
function App() {
return (
<ThreeLensProvider>
<Canvas>
{/* Your R3F scene */}
</Canvas>
</ThreeLensProvider>
);
}2
3
4
5
6
7
8
9
10
11
12
Issue: Stats not updating in R3F
Solution:
// Use ThreeLensCanvas instead of Canvas for automatic connection
import { ThreeLensCanvas } from '@3lens/react-bridge';
function App() {
return (
<ThreeLensProvider>
<ThreeLensCanvas>
{/* Auto-connects to renderer and scene */}
</ThreeLensCanvas>
</ThreeLensProvider>
);
}2
3
4
5
6
7
8
9
10
11
12
Vue / TresJS
Issue: "useThreeLens must be used within a component with ThreeLensPlugin"
Solution:
// main.ts
import { createApp } from 'vue';
import { ThreeLensPlugin } from '@3lens/vue-bridge';
const app = createApp(App);
app.use(ThreeLensPlugin);
app.mount('#app');2
3
4
5
6
7
Issue: TresJS probe not connecting
Solution:
<script setup>
import { useTresProbe } from '@3lens/vue-bridge';
// Call inside TresCanvas context
const { isConnected } = useTresProbe();
</script>
<template>
<TresCanvas>
<!-- useTresProbe auto-connects here -->
</TresCanvas>
</template>2
3
4
5
6
7
8
9
10
11
12
Angular
Issue: "NullInjectorError: No provider for ThreeLensService"
Solution:
// app.module.ts
import { ThreeLensModule } from '@3lens/angular-bridge';
@NgModule({
imports: [
ThreeLensModule.forRoot({
appName: 'My Angular App'
})
]
})
export class AppModule {}2
3
4
5
6
7
8
9
10
11
Build Tool Issues
Vite
Issue: "Failed to resolve import '@3lens/core'"
Solution:
// vite.config.ts
export default defineConfig({
optimizeDeps: {
include: ['@3lens/core', '@3lens/overlay']
}
});2
3
4
5
6
Webpack
Issue: "Module not found: Can't resolve '@3lens/core'"
Solutions:
Check your resolve configuration:
javascript// webpack.config.js module.exports = { resolve: { extensions: ['.ts', '.js', '.mjs'], mainFields: ['module', 'main'] } };1
2
3
4
5
6
7If using TypeScript, ensure ts-loader or babel handles the files
Next.js
Issue: "window is not defined" (SSR error)
Solution: Use dynamic import with SSR disabled:
import dynamic from 'next/dynamic';
const ThreeLensCanvas = dynamic(
() => import('@3lens/react-bridge').then(mod => mod.ThreeLensCanvas),
{ ssr: false }
);2
3
4
5
6
Performance Issues
High Memory Usage
Symptoms: Browser memory climbing steadily
Solutions:
Reduce history buffer size:
typescriptconst probe = createProbe({ sampling: { historyLength: 60, // Reduce from default 120 } });1
2
3
4
5Increase sampling interval:
typescriptconst probe = createProbe({ sampling: { frameInterval: 2, // Sample every other frame } });1
2
3
4
5
Devtools Causing Frame Drops
Solutions:
Reduce update frequency:
typescriptconst probe = createProbe({ sampling: { frameInterval: 3, // Less frequent updates snapshotInterval: 120, // Less frequent snapshots } });1
2
3
4
5
6Hide the overlay during performance-critical moments:
typescript// Temporarily hide during cutscene overlay.hide(); // ... play cutscene ... overlay.show();1
2
3
4
Still Having Issues?
If none of these solutions work:
Enable debug mode for detailed logging:
typescriptconst probe = createProbe({ debug: true });1Check the browser console for warnings or errors
Create a minimal reproduction - often the issue becomes clear when isolating the problem
File an issue on GitHub with:
- Your environment (Node version, browser, bundler)
- Package versions (
npm list @3lens/core) - Error messages and console output
- Minimal code to reproduce
Next Steps
- Getting Started - Basic setup guide
- Configuration - All configuration options
- First Debugging Session - Start debugging your scene