Category

TypeScript

Explore our curated collection of articles, insights, and stories about TypeScript.

141 Articles
TypeScript

Fix ESLint: Module.createRequire is not a function

Reproduced on Node 10 vs Node 18 with the same node_modules: the crash is the Node runtime executing ESLint, not Parcel or a broken module resolution.

8 min read
TypeScript

Fix "X is not a constructor" from a plain require()

Why adding a property to exports and then requiring it without destructuring hands you an object instead of a constructor, reproduced on current Node.js.

7 min read
TypeScript

Fix tar EPERM: operation not permitted, futime

Reproduce the ownership mismatch behind the warning, see how a current npm install actually fails, and fix the layer that creates it.

9 min read
TypeScript

Tailwind upgrade: Could not load the configuration file

Reproduced on Windows 11 with a virtual drive: the exact failing version, why @next still breaks today, and the command that migrates a v3 project cleanly.

7 min read
TypeScript

Fix Failed to replace env in config: NPM_TOKEN

Separate an npmrc parsing failure from registry authentication, with reproduced npm and Yarn Classic controls and a secret-safe CI fix.

8 min read
TypeScript

Fix Vite: Preprocessor dependency "sass" not found

Separate a missing Sass compiler from a webpack loader, an omitted build dependency and a Tailwind integration error before changing your configuration.

8 min read
TypeScript

Fix pnpm ERR_PNPM_LINKING_FAILED on Windows

Find the process or path preventing a pnpm rename, distinguish a locked package from a version regression, and retain the dependency resolution.

9 min read
TypeScript

Fix pnpm ERR_PNPM_OUTDATED_LOCKFILE in CI

Find the mismatched workspace importer, align the pnpm version, and prove the repaired lockfile installs without changing a byte.

8 min read
TypeScript

Fix Vite React error #130: react-multi-carousel

A current client bundle reproduces the carousel import failure before hosting, then renders successfully after changing only the component value.

8 min read
TypeScript

Fix slow Tailwind v3 in Vite: remove catch-all safelists

Separate oversized generated CSS from plugin cost, with a single-change compiler reproduction and an Autoprefixer negative control.

8 min read
TypeScript

Fix npm ENOTEMPTY: directory not empty, rename

Read both paths in the rename error, preserve your lockfile, and distinguish a stale retirement directory from an npm regression or a file lock.

9 min read
TypeScript

Fix pnpm Ignored Build Scripts for Native Dependencies

Reproduce a missing SQLite binding, approve only its installer, and keep the same permission working in CI without enabling every dependency script.

9 min read
TypeScript

Tailwind v4 @source inline(): replace the v3 safelist

Trace an absent grid utility through a production build, replace the legacy safelist, and include shared UI classes without generating every combination.

9 min read
TypeScript

Fix Vite: crypto.hash is not a function

Check the Node binary that actually starts Vite, distinguish API availability from the supported version range, and verify the fix without replacing the lockfile.

8 min read
TypeScript

Fix Vitest: Cannot find namespace vi in TypeScript

Keep mock return values checked against the real function signature, and verify both TypeScript compilation and module mocking at runtime.

8 min read
TypeScript

Fix Zod 4: errors Does Not Exist on ZodError

Repair the missing errors property without losing nested paths, hiding validation failures or turning unexpected exceptions into form errors.

9 min read
TypeScript

Fix Jest Cannot find module on absolute path imports

Why an import that already matches moduleDirectories still throws Cannot find module: a failing test, then a passing one, for two different fixes.

7 min read
TypeScript

Fix: Local package.json exists, but node_modules missing

Why cloning a repository never brings its dependencies with it, and the one command that turns a missing-binary failure into a working start script.

7 min read
TypeScript

Fix dyld "missing symbol called" in Node on an M1 Mac

Find which of Node, the compiled addon and the system library is on the wrong CPU architecture, line them up, and know what the follow-up errors mean.

9 min read
TypeScript

Fix RangeError: Invalid time zone specified in Node.js

Find which of the three causes threw the error, from the value printed after the colon, and make toLocaleString and Intl.DateTimeFormat accept the zone again.

8 min read
TypeScript

Fix dotenv: command not found in a NestJS start script

Get a NestJS start:dev script that calls dotenv -e running again, and avoid the dotenv 18 binary that now answers with a usage screen instead.

7 min read
TypeScript

Fix ERR spawn EINVAL from npx install-peerdeps on Windows

Why a lint script that adds Airbnb ESLint config with Yarn dies on Windows with ERR spawn EINVAL, the one-word change that makes it run, and what the fixed release does to your version ranges.

8 min read
TypeScript

Google Fonts not working in Tailwind + Vite: @import order

Why the font-inter class exists but the text stays in the default face in a React and Vite project, and the one-line move that makes the browser download Inter.

7 min read
TypeScript

Owl Carousel not working after Vite build: reading 'fn'

Why Owl Carousel works under the Vite dev server but dies in dist, and the two changes a fresh npm install now needs before the carousel loads again.

8 min read
TypeScript

Vite server running but not working on localhost: 3 causes

Tell in one request whether Vite itself answered 404 or another server did, then move index.html, pin the host or free the port, and confirm it with curl.

8 min read
TypeScript

Fix Docker npm EBADENGINE: Unsupported engine

Read the Required and Actual lines, distinguish npm self-upgrades from application installs, and stop a floating npm release breaking an unchanged Dockerfile.

7 min read
TypeScript

Fix npm EACCES: permission denied on package-lock.json

Separate a local lockfile permission failure from cache and global-install errors, then fix the owner without changing the dependency tree.

7 min read
TypeScript

Vite failed to scan dependencies: unwanted HTML entries

Reproduce a dependency scan that includes gitignored documentation, then narrow the entry list without hiding syntax errors in the application itself.

7 min read
TypeScript

Fix Babel "native ECMAScript module configuration file"

Get babel-jest loading your Babel config again in a "type": "module" project, and see which Node versions never hit the error at all.

7 min read
TypeScript

Fix TS2688: node_modules Is the Wrong typeRoots

Reproduce the broad typeRoots mistake, distinguish it from missing @types packages, and preserve custom global declarations while repairing tsconfig.

7 min read
TypeScript

Vite linked React library: fix Invalid hook call

Separate a library bundling mistake from linked-package resolution, keep React external, and prove that the component and renderer use the same React.

8 min read
TypeScript

Fix 'props.handleSelect is not a function': wrong prop

Match the prop name on both sides of the component boundary to stop the crash, and see why optional chaining or a default value only hides it instead.

8 min read
TypeScript

Fix ERR_REQUIRE_ESM on cPanel Node.js apps (Passenger)

What Phusion Passenger's own loader script does, why it throws ERR_REQUIRE_ESM on an ESM app.js, and the fix, reproduced on Node 14, 18 and 22.

9 min read
TypeScript

Fix 'The keyword enum is reserved' in ESLint + TypeScript

Why replacing react-app with airbnb drops the TypeScript parser Create React App quietly provided, and the one-line fix for both flat config and the now-removed .eslintrc format.

9 min read
TypeScript

Fix 'was not found by the project service' in ESLint

Stop ESLint from type-checking your compiled dist output, and avoid the newer project-vs-projectService conflict that now hides this exact message.

9 min read
TypeScript

Fix Vite "Cannot find package vite" in vite.config.ts

Why vite vanishes from node_modules after a clean install, reproduced on npm 9.5.0 and Node 18 with a global vite install, plus the extra step the fix needs to outlast the next npm install.

7 min read
TypeScript

Fix secretOrPrivateKey must have a value in NestJS JWT

Reproduced on @nestjs/jwt 12.0.3 and 10.0.3: why a configured JwtModule still signs with an empty key, why two popular answers fall short, and the .env load-order variant of the same error.

8 min read
TypeScript

Fix Vite: local module 'does not provide an export named'

Reproduced with Node's own ES module loader: why the browser's loader finds no export in a tsc CommonJS build, and why two of the three moduleResolution values the top answer lists don't compile.

8 min read
TypeScript

Chrome hangs with Vite dev server: raise the file limit

See why only Chrome stalls on a big Vite app while Firefox loads it, reproduce the stall with one changed limit, and make the fix survive a reboot.

8 min read
TypeScript

Fix curl getaddrinfo() thread failed to start in Docker

Why curl fails to resolve a host in a RUN step on one server and not on your laptop, how to prove it is the engine and not the image, and which fix to pick.

7 min read
TypeScript

Module resolves to an untyped module: fix TS2665 in .d.ts

Why a hand-written declaration for an untyped package fails with "cannot be augmented", why the same block works in a .d.ts but not a .ts file under module node16 to nodenext, and the one-line move that fixes it.

7 min read
TypeScript

SyntaxError: Unexpected token import means an old Node.js

Read the exact wording of the error to learn which runtime ran your code, then choose between upgrading Node and staying on CommonJS with a pinned dependency.

7 min read
TypeScript

Fix npm ERR! Unexpected token '.' with nvm-windows

How to confirm the broken libnpmfund file in under a minute, why only npm 8.3.1 and later trip on it, and the reinstall that actually repairs the Node version you already have.

7 min read
TypeScript

Fix Cannot find type definition file for 'body-parser'

Why one broken folder under node_modules/@types fails the whole project, why restarting VS Code sometimes clears it, and what TypeScript 6.0 changed.

8 min read
TypeScript

Failed to parse source map: fix the missing src warning

Find which package ships the broken source map, fix it at the source if it is yours, and silence it precisely if it is not, without losing your own debugging.

8 min read
TypeScript

Fix TS1084 Invalid 'reference' directive in @types/node

Why a types release from 2 September 2020 broke TypeScript 2.x builds overnight, why skipLibCheck does not help, and two fixes reproduced in Docker.

7 min read
TypeScript

Fix nvm use "exit status 1: Access is denied" on Windows

Why nvm install works and nvm use does not on nvm-windows 1.x, what Windows actually refuses, and three fixes: one elevated shell, Developer Mode with a user-owned symlink, or v2.

8 min read
TypeScript

Tailwind @apply not working in Storybook: add postcss-loader

Why a Sass CSS module ships a literal @apply line into Storybook with no error, why importing globals.css does not change it, and the one-loader fix, reproduced on webpack 5.

8 min read
TypeScript

Fix shadcn CLI wrong component paths with extended tsconfig

Why npx shadcn add creates a literal @renderer folder or writes outside your project in electron-vite and WXT apps, and three fixes reproduced on shadcn 4.22.1.

8 min read
TypeScript

npm install stuck on idealTree buildDeps: find the stall

Reproduced on npm 10.9.9 against a server that accepts the connection and never replies: what each log level shows, why fetch-timeout does not end the wait, and the one-line fix.

8 min read
TypeScript

require() of ES Module string-width: fix yarn.lock in Docker

Why yarn install in a node:18 container dies in node-gyp with ERR_REQUIRE_ESM from wide-align, how to spot the broken yarn.lock entry, and two fixes reproduced in Docker.

8 min read
TypeScript

Expected identifier but found "import" (define name) in Vite

Why a Vite 6 project stops before the dev server starts, why reinstalling from the same lockfile brings the error back, and the one-line update that clears it.

7 min read
TypeScript

Import a directory of files in a loop: TS1343, require()

Two working loaders for a folder of Express route files, one synchronous and one async, plus the startup-order bug that forEach with import() hides. Reproduced in Docker.

9 min read
TypeScript

Fix Invalid options object: allowedHosts[0] with CRA proxy

Find which of the two triggers crashes npm start, pick a fix that still proxies your API calls, and avoid the http-proxy-middleware v3 path trap.

7 min read
TypeScript

Fix grpc-tools 404 on darwin-arm64.tar.gz (Mac M1)

Get grpc_tools_node_protoc running on an Apple Silicon Mac, understand why every workaround still needs Rosetta 2, and check which binary actually landed in node_modules.

9 min read
TypeScript

Type instantiation is excessively deep: defer or cap it

Make a recursive union type compile inside generic functions again, without losing the payload checks on concrete modules.

8 min read
TypeScript

Tailwind CSS not working after Vite build: dev vs dist

Find out in two commands whether the built CSS really lacks your classes or the browser never loaded it, then apply the one change that fixes each case.

8 min read
TypeScript

Fix Vite 'Top-level await is not available' build error

Why vite dev works but vite build fails on a top-level await, which setting fixes the build and which one only fixes dev, reproduced on Vite 2.9, 5.4, 7.3 and 8.3.

8 min read
TypeScript

Fix "esbuild-linux-64" could not be found: Vite in Docker

Why vite dev fails in a node:16-slim container with a mounted frontend folder, why npm rebuild esbuild works there but not on current Vite, and the compose change that holds.

8 min read
TypeScript

Fix Cannot find module defined in tsconfig paths at runtime

Why tsc compiles an @alias import cleanly and Node still crashes on it, and five runtime fixes tested on Node 22 with TypeScript 5.9.3 and 7.0.2.

8 min read
TypeScript

Custom font is not working in Tailwind CSS: fix @font-face

Why DevTools shows your Tailwind font family while the text stays in the default face, and the two-line @font-face change that makes the file load.

7 min read
TypeScript

Fix 'ESLint was configured to run on' in Cypress tests

Keep the Cypress folder out of the root tsconfig, as Cypress recommends, and still lint every .cy.ts file with type information.

8 min read
TypeScript

Fix esbuild spawnSync ETXTBSY in Docker: Node 20.3 io_uring

Why npm install of esbuild started failing with ETXTBSY on node:20.3 images in June 2023, what changed in libuv and Docker since, and the build fix that holds today.

8 min read
TypeScript

Fix "No license field" when package.json has a license

Read the path in the warning, find the stray package.json above your project, and silence the line without inventing an open-source licence.

7 min read
TypeScript

Cannot use 'import.meta' outside a module: Jest + Vite fix

Three fixes for import.meta.env in Jest tests of a Vite app, each reproduced, plus the secret-leak trap in the popular process.env answer.

8 min read
TypeScript

Fix slow Docker ARM64 multi-platform builds on GitLab CI

Stop waiting on an emulated arm64 build to time out the job: three fixes, in the order that actually removes the wait instead of just hiding it.

9 min read
TypeScript

Fix: TypeError: Invalid PostCSS Plugin found at: plugins[0]

A postcss.config.js that lists plugin names as plain strings compiles nothing — the array syntax needs each entry already resolved, not a package name.

7 min read
TypeScript

Fix: unable to determine transport target for pino-pretty

Reproduce the exact failure in a clean container, then pick the right fix: skip the transport outside production, install pino-pretty as a real dependency, use it as a stream, or wire up a bundler plugin.

9 min read
TypeScript

Fix MikroORM: global EntityManager instance is disallowed

A fresh MikroORM 5/6 project throws a ValidationError on the first em.create() call. Here is why the global EntityManager is blocked, and the two ways to fix it properly.

7 min read
TypeScript

Docker: Run a Shell Command Before ENTRYPOINT at Startup

Your envsubst step ran while the image was built, long before the container got its variables. A small entrypoint script runs it at start-up instead and still hands control to npm or node.

8 min read
TypeScript

Fix Day.js: dayjs_1.default is not a function

Separate a successful type check from a callable runtime import, and avoid the namespace workaround that fails when interop is enabled.

8 min read
TypeScript

Fix Tailwind v4 padding and margin not working

Prove that the utility exists but loses the CSS cascade, restore spacing with one layer change, and inspect the child margins behind space-x.

8 min read
TypeScript

Fix npm Conflicting peer dependency: react@16.14.0

Read the package refusing your installed React version, distinguish the alternative candidate from the selected version, and preserve a verifiable lock file.

8 min read
TypeScript

Fix Tailwind v4: dark class changes no background colour

Keep one bg-bgContrast class while changing its inherited colour, with real browser checks for the wrong theme syntax and the inline-token trap.

8 min read
TypeScript

Fix Vite 'global is not defined': shim or move fs code

Why each define line only reveals the next error with fs-extra (reproduced on Vite 2.9.5), which shim works for Buffer-based libraries on Vite 2 and 8, and how to type it.

8 min read
TypeScript

Fix Cannot find name 'AbortSignal' in axios typings

Which axios releases trigger TS2304, why upgrading axios no longer clears it, and the tsconfig fixes reproduced on TypeScript 4.5.2 and 7.0.2.

8 min read
TypeScript

Fix: Directory import is not supported resolving ES modules

Why Node throws ERR_UNSUPPORTED_DIR_IMPORT under "type": "module", three fixes reproduced on Node 24, and why the old specifier flag no longer helps.

7 min read
TypeScript

Fix ERR_MODULE_NOT_FOUND: relative import missing .js

Why an Express app with "type": "module" cannot find ./config/app, why the flags from older answers now do nothing, and how TypeScript catches it at compile time.

8 min read
TypeScript

Vite build Unexpected token in node_modules: fix define

Why vite build fails on react-router-dom while vite dev works, which define line triggers it, and a polyfill setup that builds, reproduced on Vite 2.9.12.

9 min read
TypeScript

Fix tsc SyntaxError: Unexpected token '?' on old Node.js

Find which Node actually runs tsc, move it to a supported runtime or pin a compiler that matches it, and avoid the different error a plain npm install -g typescript now gives on Node 12 and 14.

7 min read
TypeScript

Fix Vite [commonjs--resolver] Failed to resolve entry

Reproduced on Vite 3, 4, 7 and 8: why a CommonJS dependency makes vite build stop on a package entry, why the odd "main" field is not the cause, and three fixes that each work on their own.

8 min read
TypeScript

Fix Failed to resolve "@tailwindcss/vite": ESM only error

Why a Vite 6 project that builds fine refuses to load the Tailwind CSS v4 plugin, reproduced step by step, with the two one-line fixes and the variant newer plugin releases print.

7 min read
TypeScript

Vite ERR_DLOPEN_FAILED: specified module could not be found

When reinstalling node_modules changes nothing, read the [cause] line: the Rollup binary is there, Windows just cannot load one of its DLLs.

7 min read
TypeScript

Fix ERR_REQUIRE_ESM in gulp: ESM-only plugins, old gulp-cli

Why renaming to gulpfile.mjs still fails on Node 24 with gulp 4, what changes on newer Node, and three fixes reproduced in Docker.

8 min read
TypeScript

npm EACCES without sudo: fix the cache and global prefix

Reproduced on npm 11.19.0: how to tell the cache EACCES from the global-install EACCES by the path line, and the two fixes npm documents that end sudo for good.

8 min read
TypeScript

npm WARN requires a peer of X but none is installed: fix

Read the peer range npm prints, install it into your app with one command, and see why the same project installs cleanly on npm 7 and later.

7 min read
TypeScript

Fix print "%s.%s.%s" invalid syntax in yarn install

Find the old node-gyp hiding in your lockfile, see why pointing it at Python 3 or Python 2 no longer works, and get yarn install green again with Dart Sass.

8 min read
TypeScript

npm ERR! Invalid version: "1" — make it full semver

Find which package.json carries the short version, rewrite it as major.minor.patch, and know which npm commands check the field on old and current npm.

7 min read
TypeScript

Fix return old(m, filename) ERR_REQUIRE_ESM in ts-node

Why the ts-node frame appears, why the dynamic import() the error suggests still fails under module commonjs, and five fixes tested on Node 18 and 24.

8 min read
TypeScript

Fix EACCES: permission denied, mkdir node_modules/.cache

Reproduced in Docker: why the cache directory cannot be created, the one-line Dockerfile move that fixes it, and why an old volume keeps the error alive after a rebuild.

7 min read
TypeScript

Ineffective mark-compacts near heap limit: npm build fix

Find the heap cap your build actually runs under, raise it in the place that reaches the crashing process, and avoid the two spellings that silently change nothing.

8 min read
TypeScript

Fix babel-node: not found on Heroku (devDependencies pruned)

Make a Babel-based Node app start on Heroku: see what the Node.js buildpack removes after the build, then move the compile step to build time so npm start only needs node.

8 min read
TypeScript

Fix tsc is not recognized: run the local compiler

Prove that TypeScript is installed, then make Command Prompt and VS Code build with that project version without a global compiler.

7 min read
TypeScript

Vite entry module (index.html): fix .dockerignore

Reproduce a Docker build failure caused by excluded HTML, then repair the context with a single ignore-file exception.

8 min read
TypeScript

Fix Tailwind v4 IntelliSense not working in VS Code

Find which layer has stopped working: Tailwind project discovery, document mapping, or automatic suggestions inside JSX strings.

8 min read
TypeScript

Fix: exports is not defined in ES module scope

How Node decides CommonJS vs ES module, and three remedies for aligning source syntax, compiler output and the runtime.

7 min read
TypeScript

Fix: Jest SyntaxError Unexpected token export (uuid library)

The fix depends on whether the stale uuid build is yours or a transitive dependency's — here is how to tell, and the exact config for each case.

8 min read
TypeScript

Prettier and ESLint Indent Rules Conflicting: the Fix

Stop fighting indent: Expected indentation of 2 spaces but found 4 by turning off the rule that conflicts with Prettier, not by retuning it.

8 min read
TypeScript

Tailwindcss not working with Next.js: fix the config

A Next.js build that finishes clean but ships a page with zero Tailwind styling almost always has one wrong setting: the paths Tailwind scans for class names.

7 min read
TypeScript

Fix: No loader is configured for ".node" files (Vite)

Trace the import that brings a native addon into the dev scan, and distinguish the tested Vite 4 behaviour from newer bundlers.

7 min read
TypeScript

Unexpected any. Specify a different type: fix or disable

Make @typescript-eslint/no-explicit-any go quiet for the right reason: a scoped disable that ESLint actually reads, a config override, or a real type.

8 min read
TypeScript

Cannot access 'Player' before initialization: ESM cycle

Find the import loop behind the ReferenceError with madge, then cut the one edge that points from the base class back to its subclasses.

8 min read
TypeScript

Fix shadcn "No Tailwind CSS configuration found" in Vite

What shadcn init actually looks for before it says Tailwind is missing, reproduced on Tailwind 3 and 4 with the one line that fixes each.

8 min read
TypeScript

Fix "Cannot apply unknown utility class border-border"

Reproduced on Tailwind 4.1.4 to 4.3.3 and 3.4.19: the four wordings of this error, the @config path that resolves, the hsl() trap in @theme, and the two v3 causes.

9 min read
TypeScript

Fix "Missing specifier" & npx tailwindcss init Errors

Why a clean npm install turns a working Vite + Tailwind build into three errors at once, reproduced one at a time with the fix for each.

8 min read
TypeScript

Fix ERR_IMPORT_ASSERTION_TYPE_MISSING when importing JSON

Match the import form to the Node.js release that runs your code, make tsc flag the missing attribute at build time, and handle the two errors that come next.

9 min read
TypeScript

Fix 'Missing parameter name at 1' in Express 5 routes

Your Express 5 server crashes at start-up. One changed route string brings it back, and on current installs the message itself names the route to change.

9 min read
TypeScript

Fix Cannot find module @rollup/rollup-win32-x64-msvc

Find out where your node_modules came from, reinstall it for the machine that runs Vite, and avoid the popular fix that breaks Linux CI and Docker builds.

8 min read
TypeScript

Fix error:0308010C digital envelope routines::unsupported

Find which part of your build still asks for MD4, apply the one-line workaround to unblock a deploy, then remove it with a webpack or react-scripts upgrade.

8 min read
TypeScript

Fix Node Sass could not find a binding for your environment

Read the two environment lines in the error, rebuild the binding for the Node that actually runs your build, and know when the only real fix is moving to Dart Sass.

8 min read
TypeScript

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: subpath not in exports

Read the package exports map, tell a private deep import from an import-only entry, and pick the one change that makes the require or import resolve.

9 min read
TypeScript

Fix gyp: No Xcode or CLT version detected! in npm install

Learn which of the three checks node-gyp runs on macOS is failing, repair the Command Line Tools, and get native modules compiling again.

9 min read
TypeScript

Fix: import.meta.env Undefined on Production Build (Vite)

Vite strips anything not prefixed VITE_ out of the client bundle on purpose — here is how to confirm that's the cause and the three ways to fix it.

6 min read
TypeScript

Fix: ReferenceError: jest is not defined (ESM tests)

Access Jest's mocking object in native ESM tests without confusing it with the test, expect and global names that remain available by default.

6 min read
TypeScript

Fix Cannot find module '@vitejs/plugin-react' in Vite

Read one line of the tsc output to tell a missing package from a resolution setting, then fix vite.config.ts in the tsconfig that actually owns it.

7 min read
TypeScript

Fix npm WARN package.json: No repository field

The warning is informational and harmless. Silence it for good in an application, fill it in properly for a library, and know why modern npm no longer prints it.

7 min read
TypeScript

Fix: Tailwind PostCSS Plugin Has Moved (Vite + React)

The exact steps to resolve the Tailwind v4 PostCSS plugin relocation error in a Vite + React + TypeScript build.

7 min read
TypeScript

Fix Cannot find name 'console' in TypeScript (TS2584)

console.log fails to type-check in a Node project. See which two tsconfig settings hide console, why the compiler hint points the wrong way, and the fix.

7 min read
TypeScript

Fix Rollup failed to resolve import "/src/main.tsx" in Vite

Vite build fails with 'Rollup failed to resolve '/src/main.tsx'' when index.html is placed inside src and the script tag uses an absolute path. Fix it by correcting the file structure.

4 min read
TypeScript

Fix 'originalKeywordKind' DeprecationError in TypeScript

The 'originalKeywordKind' DeprecationError fires when @typescript-eslint packages are stuck on v5 while TypeScript moved on. Upgrade to v6.x and restart ESLint to clear it.

7 min read
TypeScript

Fix: compilerOptions.paths Must Not Be Set (Alias Imports)

A tsconfig "paths" alias that works with the TypeScript compiler but breaks Create React App's build. Why CRA specifically forbids it, and three ways to keep clean "@/..." imports anyway.

7 min read
TypeScript

Fix Extremely Slow Drizzle IntelliSense on Large Schemas

Drizzle schema files make tsserver grind to a halt on large table sets. Here are the upgrade and cast trick that restore completions.

7 min read
TypeScript

Cannot use JSX unless the '--jsx' flag is provided

The tsconfig jsx option is set, but the editor still reports the JSX flag error. Here's how to force VS Code to use the project's TypeScript version and apply the change.

7 min read
TypeScript

Fix ESLint 'import/extensions' Definition Not Found

The import/extensions error appears when the eslint-plugin-import package isn't loaded. Register the plugin and extend airbnb-base to resolve it.

7 min read
TypeScript

Fix TS7053: Element Implicitly Has an Any Type When Indexing

TypeScript throws TS7053 when a plain string indexes a typed object. Use keyof typeof, index signatures, or Record to fix it safely.

8 min read
TypeScript

Fix An index signature parameter type cannot be a union

TypeScript blocks union types in index signatures. Learn why the error fires and how to fix it with mapped types or the Record utility type in under a minute.

7 min read
TypeScript

Force tsc to Ignore node_modules: Fix TS Errors

Run tsc --noEmit on a project that compiles fine in the editor and the terminal lights up with type errors from inside node_modules. The fix is skipLibCheck, plus two

7 min read
TypeScript

TypeScript 6.0 Migration: What Actually Breaks in Next.js/Supabase

TypeScript 6.0 shipped in March 2026 with strict mode on by default and several legacy options removed. Here is what actually breaks migrating a real Next.js + Supabase codebase, in the order to fix it.

11 min read
TypeScript

Fix tsconfig Paths Not Working in Next.js

The @/* alias fails in four different places for four different reasons. A 60-second checklist, then a fix per resolver: Next.js build, TS server, Jest and ESLint.

7 min read
TypeScript

TypeScript in 2026: Install & Configure with Node.js 20+

After npm install typescript@latest, builds break with Cannot find module @types/node or Property auth does not exist on SupabaseClient. The cause is a type-definition mismatch, not Node.js — here is the alignment fix.

9 min read
TypeScript

TypeScript Getter Setter Errors: TS1056, TS2378, TS2380 Fix

TypeScript getter/setter errors come from ES target misconfiguration or type mismatches. Fix TS1056, TS1028, and TS2378 in minutes.

8 min read
TypeScript

JSX.Element vs ReactNode vs ReactElement: TS2322 Fix

Fix TS2322 by understanding when ReactNode, JSX.Element, and ReactElement apply in React + TypeScript component typing.

9 min read
TypeScript

TS7016: Could not find a declaration file for module (fix)

TS7016 fires when you import an untyped JavaScript module under noImplicitAny. The right fix is usually `npm i -D @types/X` — but sometimes the package already ships types, and sometimes you need to write a one-line declaration.

8 min read
TypeScript

Fix TS2305: Module Has No Exported Member in TypeScript

TS2305 says the export you're importing doesn't exist under that name. The cause is almost always one of: a typo, default-vs-named confusion, a CJS/ESM interop mismatch, or @types drifting from the runtime package. Each has a precise fix.

8 min read
TypeScript

TS2564: Why Constructor Methods Don't Count as Init

TS2564 fires when a class field is typed but never guaranteed to be set. The fix depends on WHY it's unset: a default value, constructor assignment, the definite-assignment `!`, or an optional `?`. Picking the wrong one hides real bugs.

8 min read
TypeScript

Fix "Property does not exist on Window" in TypeScript

Learn how to safely extend the Window interface in TypeScript with declaration merging and declare global, and why bracket notation on an undeclared key fails under noImplicitAny.

9 min read
TypeScript

How to Convert a String to Number in TypeScript: 2026 Fix

Stop getting NaN or type errors when converting strings to numbers in TypeScript. Use parseInt, Number(), unary +, and runtime guards safely.

8 min read
TypeScript

TypeScript ! Operator: Fix Object Is Possibly Undefined

The TypeScript ! operator asserts non-nullability but bypasses type safety. Learn when it breaks, why it's dangerous, and safer alternatives.

9 min read
TypeScript

Interfaces vs Types in TypeScript: 2026 Best Practices

Stop guessing which to use: interfaces or types in TypeScript. This guide shows exactly when each shines, with concrete examples and migration tips.

8 min read
TypeScript

Type Safety Guide for Next.js + Supabase in TypeScript

Master end-to-end type safety in Next.js with Supabase. Learn database type generation, Zod validation, type-safe queries, and TypeScript patterns for production apps.

19 min read
TypeScript

Migrate JavaScript to TypeScript with ts-migrate (2026)

Migrate a JS codebase to TypeScript file-by-file — no full rewrite required. The tsconfig settings, file order, and tricks for handling untyped packages along the way.

13 min read