Topic Hub · 161 articles

TypeScript Type Errors: Fixes for Next.js Developers

Every fix here traces the error back to the type-system rule that produced it, not just the one-line patch — so the same class of error is recognizable the next time it shows up under a different message.

Compiler errors

22 items
01
Article·8 min read

TypeScript Getter Setter Errors: TS1056, TS2378, TS2380 Fix

TS1056 means an ES3 target (removed in TypeScript 5.5); TS2378 means a getter with no return value; TS1028 is a duplicate modifier. Fixes for each.

Read
02
Article·8 min read

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

TS7016 means the JS package ships no types and no @types/* exists. Three fixes ranked: install @types, write a local .d.ts, or use declare module.

Read
03
Article·8 min read

Fix TS2305: Module Has No Exported Member in TypeScript

"Module 'X' has no exported member 'Y'" (TS2305) usually means a default-vs- named import mismatch, a CommonJS interop gap, or a stale @types version.

Read
04
Article·8 min read

TS2564: Why Constructor Methods Don't Count as Init

TS2564 fires because strictPropertyInitialization never analyses methods called from the constructor — only direct assignments count. Five fixes, ranked.

Read
05
Article·9 min read

Fix "Property does not exist on Window" in TypeScript

Resolve TypeScript errors when assigning custom properties to window by extending the Window interface with declaration merging.

Read
06
Article·7 min read

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

TS2584: your lib has no dom and Node's types aren't loaded. Install @types/node and list it in tsconfig types; TypeScript 6.0 stopped auto-loading.

Read
07
Article·8 min read

Fix TS7053: Element Implicitly Has an Any Type When Indexing

Stop the TS7053 error when using a string to index an object. Learn keyof typeof, index signatures, and type assertions to fix dynamic property access.

Read
08
Article·7 min read

Fix An index signature parameter type cannot be a union

Stop the TS error when using an enum or union as an object key. Replace the broken index signature with a mapped type or Record utility type.

Read
09
Article·7 min read

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

VS Code still flags 'Cannot use JSX unless the --jsx flag is provided' after setting jsx: react? Select the workspace TypeScript version.

Read
10
Article·11 min read

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

TypeScript 6.0 defaults to strict mode, drops ES5 targets, and removes classic module resolution. Here is what breaks in a real Next.js + Supabase project, and the fix order.

Read
11
Article·9 min read

Fix ERR_IMPORT_ASSERTION_TYPE_MISSING when importing JSON

Node.js only loads a JSON module when the import declares type json. Add with { type: 'json' }; Node 22 and later reject the old assert form.

Read
12
Article·7 min read

Cannot assign to 'current' (read-only): useRef TS2540 fix

On @types/react 18, useRef<T>(null) is read-only unless T includes null. Write (() => void) | null or HTMLInputElement | null to fix TS2540.

Read
13
Article·8 min read

Fix Cannot find name 'AbortSignal' in axios typings

axios typings name the global AbortSignal, which an ES-only lib and old @types/node never declare. Load @types/node for your Node major, or add DOM.

Read
14
Article·7 min read

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

TypeScript 5.1+ uses the ?? operator, which Node 12 and older cannot parse. Run tsc on a current Node LTS, or pin TypeScript 4.9.5 on Node 12.

Read
15
Article·8 min read

Type instantiation is excessively deep: defer or cap it

A recursive type evaluated on an unresolved generic hits the checker instantiation limit. Defer it with a distributive conditional, or cap its depth.

Read
16
Article·7 min read

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

@types/node 6.14.11+ uses a reference lib directive that TypeScript 2.x cannot parse. Pin @types/node 6.14.10 exactly, or move TypeScript to 3.x.

Read
17
Article·8 min read

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

TS2688: a folder in node_modules/@types has no declaration file, and before TypeScript 6.0 every folder there loads. Reinstall, delete it, or set types.

Read
18
Article·7 min read

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

A top-level import or export turns your declare module block into an augmentation, which an untyped JS package cannot take. Move the import inside.

Read
19
Article·7 min read

Fix TS2688: node_modules Is the Wrong typeRoots

TS2688 across ordinary packages can mean typeRoots includes all of node_modules. Narrow the roots and check the types default for your compiler.

Read
20
Article·7 min read

Fix TS2882: side-effect import of './globals.css'

TypeScript 7 checks side-effect CSS imports by default; TS 5.x needs a flag. Add declare module "*.css" {}, or switch VS Code to the workspace TypeScript.

Read
21
Article·9 min read

Fix Zod 4: errors Does Not Exist on ZodError

Zod 4 removed the ZodError.errors alias. Use issues after narrowing safeParse, then preserve field and form errors with the right formatter.

Read
22
Article·8 min read

Fix Vitest: Cannot find namespace vi in TypeScript

vi is a runtime helper, so vi.Mock is not a type. Use vi.mocked on an existing mock, or import Mock directly from Vitest.

Read

tsconfig & module resolution

20 items
23
Article·7 min read

Fix tsconfig Paths Not Working in Next.js

Cannot find module @/components? Fix tsconfig paths in Next.js: baseUrl, server restarts, Jest moduleNameMapper, ESLint resolvers and monorepo gotchas.

Read
24
Article·7 min read

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

This error comes from Create React App's build, which rejects tsconfig path aliases outright. CRACO vs. migrating to Vite or Next.js, compared.

Read
25
Article·7 min read

Force tsc to Ignore node_modules: Fix TS Errors

TypeScript compiler throws errors from node_modules even with skipLibCheck? Stop tsc from type-checking dependencies with the right tsconfig settings.

Read
26
Article·9 min read

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: subpath not in exports

The package exports map has no entry for that path, or none for require(). Import a listed subpath, or load an import-only package with import().

Read
27
Article·7 min read

Fix: exports is not defined in ES module scope

Node can load .js as ESM through package type or syntax detection. Keep CommonJS in .cjs, or replace exports with ES module syntax.

Read
28
Article·8 min read

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

ts-node compiles your import to require(), which an ESM-only package such as node-fetch 3 rejects on older Node. Keep import() real, pin v2 or upgrade.

Read
29
Article·7 min read

Fix: Directory import is not supported resolving ES modules

ERR_UNSUPPORTED_DIR_IMPORT: unlike require(), a relative import never adds index.js to a folder. Import ./database/index.js, or map a #database alias.

Read
30
Article·8 min read

Fix ERR_MODULE_NOT_FOUND: relative import missing .js

Node resolves './config/app' literally and never tries .js. Add the extension to each relative import; the old specifier-resolution flag is now a no-op.

Read
31
Article·8 min read

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

A CommonJS build calls a missing Day.js default property. Enable esModuleInterop for the default import, then check the emitted JavaScript.

Read
32
Article·8 min read

Fix Cannot find module defined in tsconfig paths at runtime

tsc leaves path aliases untouched in the emitted require(), so Node cannot find them. Register tsconfig-paths, run tsc-alias, or use package.json imports.

Read
33
Article·8 min read

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

A Vite app reading import.meta.env fails under @swc/jest because the output is CommonJS. Map one env module, or test with Vitest.

Read
34
Article·8 min read

Fix shadcn CLI wrong component paths with extended tsconfig

shadcn add reads tsconfig paths from the root file only: referenced aliases fail to resolve, extended ones land in ../src. Point it at the right config.

Read
35
Article·9 min read

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

Under module commonjs, import.meta fails (TS1343) and import() becomes require(). Load route files with require() and __dirname, or await import() in ESM.

Read
36
Article·7 min read

SyntaxError: Unexpected token import means an old Node.js

Old runtimes such as Node 8 print Unexpected token import. type: module cannot help there: upgrade Node, or use require and pin a CommonJS dependency.

Read
37
Article·8 min read

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

Vite skips CommonJS-to-ESM conversion for linked local packages. Recompile them as ES modules, or add them to optimizeDeps.include.

Read
38
Article·9 min read

Fix ERR_REQUIRE_ESM on cPanel Node.js apps (Passenger)

cPanel runs Node apps through Passenger, which require()s the entry file, not import(). Point Passenger at a tiny .cjs loader that uses import() instead.

Read
39
Article·7 min read

Fix Babel "native ECMAScript module configuration file"

Babel cannot synchronously load babel.config.js as ESM on older Node. Rename it to babel.config.cjs with module.exports, or use static JSON.

Read
40
Article·7 min read

Fix Jest Cannot find module on absolute path imports

When moduleDirectories already lists src, an import starting with 'src/' makes Jest look in src/src/ - drop the prefix or add modulePaths instead.

Read
41
Article·8 min read

Fix TransformStream is not defined in Jest

A Jest sandbox can lack TransformStream even on modern Node. Expose the native constructor in test setup, or use the runtime the test actually needs.

Read
42
Article·7 min read

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

require() returns module.exports whole; a property added with exports.X stays on that object until you destructure or reassign module.exports.

Read

Node.js & package managers

74 items
43
Article·9 min read

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

node-gyp found neither Xcode nor a Command Line Tools receipt. Install or reset the CLT with xcode-select, confirm with pkgutil, rerun npm install.

Read
44
Article·7 min read

Fix npm WARN package.json: No repository field

npm 6 and older warn when package.json has no repository field. Add "private": true to an app, or a repository object to a published package.

Read
45
Article·6 min read

Fix: sh: tsc: not found in Docker build

tsc missing in a Docker build usually means devDependencies were skipped — but it can also mean they installed and their binary never got linked.

Read
46
Article·8 min read

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

node_modules was installed for another OS, so Rollup's Windows binary is missing. Reinstall on Windows with npm ci; do not add the binary as a dependency.

Read
47
Article·8 min read

Fix Could not find a required file: index.html in Docker

A bind mount replaced the image's public/ folder with an empty host folder. Mount the right path, or drop the mount and COPY public/ into the image.

Read
48
Article·8 min read

Fix Node Sass could not find a binding for your environment

node_modules was installed under another Node version or OS. Run npm rebuild node-sass on a supported Node, or replace the end-of-life node-sass with sass.

Read
49
Article·8 min read

Fix Docker Compose environment 'unexpected type map' error

A '- KEY: value' item under environment is a YAML map, not a string. Write '- KEY=value' or drop the dash. Same fix for v1's 'invalid type' error.

Read
50
Article·9 min read

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

Express 5 parses routes with path-to-regexp 8, where a bare * as in app.all('*') has no name. Use '/{*splat}', or app.use() for a 404 handler.

Read
51
Article·9 min read

Docker 'OCI runtime create failed': a flag after the image

docker run reads its flags only up to the image name, so -w written after it becomes the command. Move docker run flags in front of the image.

Read
52
Article·7 min read

Fix Docker Compose "unknown flag: --iidfile" Build Error

Compose 1.28+ passes --iidfile to docker build. A docker CLI older than 17.06 does not know that flag. Upgrade the docker binary, not Compose.

Read
53
Article·8 min read

Fix Firebase Functions Deploy: Missing: X from lock file

npm ci fails with many "Missing: X from lock file" lines on Firebase deploy. The legacy-peer-deps mismatch that causes it, and the two real fixes.

Read
54
Article·9 min read

Fix: React hot reload doesn't work in a Docker container

On Windows, WSL2 does not forward file-change events for edits made on the Windows side. Switch the watcher to polling to fix it.

Read
55
Article·9 min read

Fix Docker Compose 'Exec format error' loading a library

A native .node binary was built on the host OS, then run unchanged inside the Linux container. Rebuild node_modules inside the image, not the host.

Read
56
Article·7 min read

Jenkins "Invalid agent type docker specified" Fix

Jenkins rejects agent { docker {} } with no Docker plugin installed. Install Docker Pipeline, not just Docker, to register the agent type.

Read
57
Article·7 min read

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

Vite 4's esbuild scan reaches fsevents.node. Remove accidental tooling imports or exclude the native watcher from optimizeDeps.

Read
58
Article·7 min read

Fix tsc is not recognized: run the local compiler

A local TypeScript install is outside the Windows command path; run it through an npm script or point your VS Code task at the project compiler.

Read
59
Article·8 min read

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

A .dockerignore exclusion can remove the Vite HTML entry. Include index.html in the Docker build context and verify it after COPY.

Read
60
Article·8 min read

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

Heroku prunes devDependencies after the build, so a start script that calls babel-node fails. Compile with Babel at build time and start with node.

Read
61
Article·7 min read

Fix EACCES: permission denied, mkdir node_modules/.cache

node_modules was installed as root, then USER switched to a non-root user who cannot create .cache. Run the install after USER, or chown it.

Read
62
Article·8 min read

Ineffective mark-compacts near heap limit: npm build fix

A build process filled its V8 heap cap. Raise the cap where that process reads it: NODE_OPTIONS for the build, memoryLimit for a forked type checker.

Read
63
Article·8 min read

Fix Cannot find module 'caniuse-lite/dist/unpacker/agents'

caniuse-lite is in node_modules but its dist folder is gone, so browserslist cannot load. Reinstall the tree with npm ci instead of npm install.

Read
64
Article·7 min read

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

npm rejects a package.json version that is not valid semver, such as "1" or "1.0". Write all three parts, "1.0.0", in the file npm names.

Read
65
Article·7 min read

Vite ERR_DLOPEN_FAILED: specified module could not be found

Windows cannot load VCRUNTIME140.dll, which Rollup before 4.9.5 imports. Run npm update rollup or install the Visual C++ Redistributable.

Read
66
Article·8 min read

Fix RabbitMQ ECONNREFUSED 5672 between Docker containers

Inside a container, localhost is not RabbitMQ. Put the service name in the amqp URL and wait on a port healthcheck, not ping: the broker boots slowly.

Read
67
Article·8 min read

Fix Sequelize "Cannot find /config/config.json" in Docker

sequelize-cli looks for config/config.json under the current directory, which is / before WORKDIR. Copy the project first, then migrate at container start.

Read
68
Article·8 min read

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

node-gyp 3.8, pulled in by node-sass 4, runs a Python 2 print under Python 3. Replace node-sass with sass, or use the node-sass that fits your Node.

Read
69
Article·8 min read

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

gulp-imagemin 8+ is ESM-only, so require() in gulpfile.js fails. Move to gulpfile.mjs with gulp 5 (gulp-cli 3.1), or pin gulp-imagemin 7.1.0.

Read
70
Article·7 min read

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

npm 3 to 6 never install peerDependencies, they only warn. Add the peer to your own dependencies with its full range, or move to npm 7+, which installs it.

Read
71
Article·8 min read

npm EACCES without sudo: fix the cache and global prefix

npm EACCES means root owns ~/.npm or the global prefix. chown the cache back, then use nvm or a user prefix so npm install -g never needs sudo.

Read
72
Article·8 min read

Fix Cannot find module 'dotenv' in Docker Compose (Node)

The bind mount replaces the image folder, node_modules included, or an old anonymous volume does. Install in the image and mount node_modules as a volume.

Read
73
Article·8 min read

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

The file a package.json points to is missing on disk, often in a nested node_modules copy. Find that copy, then reinstall, dedupe or alias it.

Read
74
Article·8 min read

Fix react-scripts: Permission denied on npm run build

The shell found react-scripts but may not execute it: the bin lost its execute bit, or the project sits on a noexec mount. Reinstall, or call it via node.

Read
75
Article·9 min read

Vite build Unexpected token in node_modules: fix define

Vite 2 pastes define values into dependencies as raw text at build time, so global: {} or a process object breaks their syntax. Remove both, then polyfill.

Read
76
Article·7 min read

Fix Nginx 502 in Docker Compose: upstream localhost

Nginx connects to its own container when the upstream is 127.0.0.1. Use the Compose service name and the Node container port.

Read
77
Article·8 min read

Fix npm Conflicting peer dependency: react@16.14.0

redux-form 8.3.7 rejects React 17 through its peer range. Update that dependency to a compatible release and verify the tree without a peer bypass.

Read
78
Article·8 min read

Docker: Run a Shell Command Before ENTRYPOINT at Startup

RUN executes at build time, so docker run -e values never reach it. Move the command into an entrypoint script that ends with exec "$@".

Read
79
Article·8 min read

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

Vite does not shim Node globals in the browser. Set window.global in a module imported first, or run code that needs fs-extra in Node instead.

Read
80
Article·8 min read

Fix Cannot find module '/dist/main' in a Docker build

The build ran before COPY . ., or tsc wrote dist/src/main.js. Copy the source before building and set rootDir to ./src so dist/main.js exists.

Read
81
Article·7 min read

Fix MikroORM: global EntityManager instance is disallowed

MikroORM v5+ blocks em.create() on the global EntityManager. Fork it per request, or wire RequestContext, instead of disabling the check.

Read
82
Article·9 min read

Fix: unable to determine transport target for pino-pretty

pino-pretty is missing or left out of a production install. Make the transport conditional on NODE_ENV, or move it to dependencies if needed in production.

Read
83
Article·9 min read

Fix slow Docker ARM64 multi-platform builds on GitLab CI

docker buildx emulates arm64 with QEMU on amd64 runners, which is slow. Pin BUILDPLATFORM for cross-compilation or build on a native arm64 runner.

Read
84
Article·7 min read

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

Yarn checks every package.json above your project. "../package.json: No license field" names a parent file: fix or delete that one.

Read
85
Article·8 min read

Fix esbuild spawnSync ETXTBSY in Docker: Node 20.3 io_uring

Node 20.3.0 images brought libuv io_uring, and esbuild's install script hit ETXTBSY in Docker. Move to a newer image or set UV_USE_IO_URING=0.

Read
86
Article·8 min read

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

Vite 2 to 6 build for browsers older than top-level await, so esbuild stops. Set build.target to esnext or es2022, or move to Vite 7, which builds it.

Read
87
Article·8 min read

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

A bind mount brings the macOS node_modules into the Linux container, so esbuild finds no Linux binary. Mask node_modules with a volume and install inside.

Read
88
Article·7 min read

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

esbuild 0.24.1 rejects the import.meta.dirname define key Vite uses to load vite.config.js, and the lockfile keeps it. npm update esbuild fixes it.

Read
89
Article·9 min read

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

grpc-tools 1.11.2 and older have no darwin-arm64 binary, so the install 404s. Upgrade grpc-tools and install Rosetta 2: the arm64 build is x86_64.

Read
90
Article·8 min read

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

wide-align requires string-width, but a Yarn 1 lockfile that merges the string-width-cjs alias hoists ESM-only v5. Regenerate yarn.lock or pin 4.2.3.

Read
91
Article·8 min read

npm install stuck on idealTree buildDeps: find the stall

npm waits silently when the registry or a proxy never answers. Log at silly to see the URL, test it with curl, then fix the .npmrc line.

Read
92
Article·8 min read

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

nvm-windows switches Node by creating a symlink, which Windows only allows as admin, or with Developer Mode outside Program Files. Elevate once or move it.

Read
93
Article·8 min read

Failed to parse source map: fix the missing src warning

A package ships a .map that names src files it does not publish. Fix the map (sourcesContent) or hide the warning; GENERATE_SOURCEMAP=false has a cost.

Read
94
Article·8 min read

Chrome hangs with Vite dev server: raise the file limit

On Linux, Chrome runs out of file descriptors on Vite's unbundled module requests and stalls. Raise nofile in limits.conf, then reboot.

Read
95
Article·7 min read

Fix curl getaddrinfo() thread failed to start in Docker

An old Docker Engine seccomp profile answers clone3 with EPERM, so a newer glibc cannot start threads. Upgrade the engine or pin an older base image.

Read
96
Article·7 min read

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

nvm-windows wrote npm's libnpmfund symlink as a text file, so Node fails to parse it. Update nvm-windows, then reinstall that Node version as admin.

Read
97
Article·8 min read

Material UI install fails on React 18 or 19 (ERESOLVE): fix

@material-ui/core is Material UI v4, whose peer range stops at React 17. Install @mui/material with Emotion rather than forcing v4 into React 18 or 19.

Read
98
Article·7 min read

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

Vite ships only as a devDependency, and npm install skips devDependencies under NODE_ENV=production or --omit=dev. Fix: npm install --include=dev.

Read
99
Article·7 min read

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

npm cannot write a root-owned package-lock.json. Check the failing path, repair that file’s ownership, and keep the lockfile instead of deleting it.

Read
100
Article·7 min read

Fix Docker npm EBADENGINE: Unsupported engine

A global npm upgrade can require a newer Node than your Docker image provides. Use a supported Node image and keep its compatible npm.

Read
101
Article·8 min read

Vite linked React library: fix Invalid hook call

A linked library can resolve a second React copy even when React is external. Dedupe React in the consuming Vite app and verify module identity.

Read
102
Article·7 min read

Vite failed to scan dependencies: unwanted HTML entries

If Vite scans broken generated HTML outside your app, restrict optimizeDeps.entries to real app entries. Read the underlying error before changing it.

Read
103
Article·8 min read

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

The Vite build wraps jQuery as CommonJS, so window.jQuery is never set and Owl Carousel crashes. Pin jQuery 3 and set window.jQuery in its own module.

Read
104
Article·7 min read

Fix dotenv: command not found in a NestJS start script

dotenv 10 to 17 ship no dotenv command; the -e/-- syntax belongs to dotenv-cli. Install dotenv-cli, or switch to nest start --env-file.

Read
105
Article·8 min read

Fix ERR spawn EINVAL from npx install-peerdeps on Windows

A Node.js security fix makes spawn() of a .cmd file without shell throw EINVAL; install-peerdeps 3.0.3 hits it. Use install-peerdeps@3.0.7 or npm.

Read
106
Article·8 min read

Fix RangeError: Invalid time zone specified in Node.js

timeZone must be an IANA name or, on Node 22+, an offset like +01:00. UTC+1 never works, and an empty TZ variable gives Etc/Unknown.

Read
107
Article·9 min read

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

A native addon was linked against a library of the other CPU architecture. Put Node and the library on one architecture, then reinstall node_modules.

Read
108
Article·7 min read

Fix: Local package.json exists, but node_modules missing

npm warns this when a script needs a binary that only exists inside node_modules. Run npm install, then retry the script.

Read
109
Article·8 min read

Fix Vite: crypto.hash is not a function

Vite calls a Node crypto API missing from older runtimes. Use a supported Node LTS release and restart Vite with the correct executable.

Read
110
Article·9 min read

Fix Docker: Client Version Is Too Old

Docker rejects an API below its supported minimum. Check the actual daemon, remove stale API overrides, then update the client or SDK making the request.

Read
111
Article·9 min read

Fix pnpm Ignored Build Scripts for Native Dependencies

pnpm blocks unreviewed dependency scripts. Approve the specific native package, check the saved policy, then verify a clean install.

Read
112
Article·9 min read

Fix npm ENOTEMPTY: directory not empty, rename

npm cannot rename a package over a non-empty destination. Inspect the exact dest path, move a confirmed stale directory aside, then retry.

Read
113
Article·8 min read

Fix pnpm ERR_PNPM_OUTDATED_LOCKFILE in CI

The manifest and pnpm lockfile disagree. Update the lockfile with the project's pinned pnpm version, commit it, then keep CI installs frozen.

Read
114
Article·9 min read

Fix pnpm ERR_PNPM_LINKING_FAILED on Windows

Windows can block pnpm renames through open handles or permissions. Inspect both paths, release the confirmed blocker and retry with your lockfile.

Read
115
Article·8 min read

Fix Failed to replace env in config: NPM_TOKEN

An npmrc token reference is missing from the process environment. Export the variable before npm or Yarn starts, or remove an unused auth entry.

Read
116
Article·9 min read

Fix tar EPERM: operation not permitted, futime

npm WARN tar EPERM futime means tar cannot set a file's mtime because the running user does not own it. Match UID/GID across the image, not sudo.

Read

Vite, Tailwind & build tooling

22 items
117
Article·4 min read

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

Vite build fails with 'Rollup failed to resolve import '/src/main.tsx''. The root cause is an index.html inside src and a custom root config. Fix it by moving index.html to the project root.

Read
118
Article·6 min read

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

import.meta.env vars work in dev but come back undefined once Vite builds for production — the fix is almost always a missing VITE_ prefix.

Read
119
Article·7 min read

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

TS2307 on @vitejs/plugin-react in vite.config.ts: install the package and restart the TS server, or set tsconfig.node.json to bundler resolution.

Read
120
Article·7 min read

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

Tailwind v4 moved its PostCSS plugin to @tailwindcss/postcss. Fix the "trying to use tailwindcss directly as a PostCSS plugin" build error.

Read
121
Article·9 min read

Fix "Cannot apply unknown utility class border-border"

Tailwind v4 no longer loads tailwind.config.js by itself, so the shadcn/ui border colour is missing. Load it with @config or move it into @theme.

Read
122
Article·8 min read

Fix "Missing specifier" & npx tailwindcss init Errors

Tailwind v4 removed the tailwindcss CLI and blocked its old subpath imports; both break after a clean npm install.

Read
123
Article·8 min read

Fix shadcn "No Tailwind CSS configuration found" in Vite

shadcn init scans your CSS for a Tailwind entry line and package.json for tailwindcss. Add the right one for your Tailwind version and re-run.

Read
124
Article·7 min read

Tailwindcss not working with Next.js: fix the config

Tailwind classes compile with no error but render nothing because the content globs miss your files — not because of the PostCSS setup.

Read
125
Article·8 min read

Fix Tailwind v4 IntelliSense not working in VS Code

Tailwind v4 IntelliSense needs a CSS entrypoint; fix detection first, then enable string suggestions if manual completion works.

Read
126
Article·7 min read

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

Vite bundles a vite.config.js as CommonJS when package.json has no "type": "module". Add that line or rename the file to vite.config.mjs.

Read
127
Article·8 min read

Fix Tailwind v4 padding and margin not working

An unlayered CSS reset overrides Tailwind v4 spacing utilities. Move the reset into @layer base, then verify computed styles.

Read
128
Article·8 min read

Fix Tailwind v4: dark class changes no background colour

The dark class needs a matching CSS variable override. Replace @theme dark: with a .dark rule and keep the same unprefixed background class.

Read
129
Article·7 min read

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

A postcss.config.js array of plugin name strings throws before PostCSS runs. Fix: require() each entry, or use the object syntax.

Read
130
Article·7 min read

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

Tailwind applies the class, but the @font-face rule never loads: format('ttf') is not a valid hint and nested quotes change the font's family name.

Read
131
Article·8 min read

Tailwind CSS not working after Vite build: dev vs dist

Built CSS is usually fine and the page is not being served; on Tailwind v2 a purge list missing index.html drops classes. Build output reproduced.

Read
132
Article·8 min read

Fix shadcn combobox: item was not found at the registry

The combobox is published only for new-york-v4 and newer styles. components.json on default, or new-york with a tailwind.config path, requests a 404.

Read
133
Article·8 min read

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

A Storybook Sass rule without postcss-loader never runs Tailwind, so @apply stays literal in .module.scss. Add postcss-loader to that rule.

Read
134
Article·7 min read

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

Tailwind v4: a Google Fonts @import below @import "tailwindcss" is ignored, and tailwind.config.js is no longer read. Move the import up, use @theme.

Read
135
Article·9 min read

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

Replace the unsupported JavaScript safelist with bounded @source inline() declarations, complete grid class tokens or registered shared UI sources.

Read
136
Article·8 min read

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

A catch-all safelist generates unused Tailwind utilities. Remove the broad pattern, retain required classes explicitly, then profile any remaining delay.

Read
137
Article·8 min read

Fix Vite: Preprocessor dependency "sass" not found

Vite needs the Sass compiler, not just sass-loader. Install sass locally with dev dependencies included, then rebuild the same SCSS import.

Read
138
Article·7 min read

Tailwind upgrade: Could not load the configuration file

On Windows, @tailwindcss/upgrade 4.0.0 cannot load a config file on another drive than its npx cache. Fixed in 4.0.1; run the latest tool, not @next.

Read

Lint, test & editor tooling

19 items
139
Article·7 min read

Fix ESLint 'import/extensions' Definition Not Found

ESLint reports 'import/extensions' not found in VS Code when the import plugin isn't registered. Add it to your config to silence the error.

Read
140
Article·7 min read

Fix 'originalKeywordKind' DeprecationError in TypeScript

Seeing 'originalKeywordKind' DeprecationError in your React TypeScript project? Upgrade @typescript-eslint/eslint-plugin and parser to v6.x to fix the parsing error.

Read
141
Article·6 min read

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

Native Jest ESM tests need an explicit jest import. Import it from @jest/globals to use jest.fn() and the other mock APIs.

Read
142
Article·7 min read

Fix Extremely Slow Drizzle IntelliSense on Large Schemas

TypeScript IntelliSense stalls for seconds in drizzle(sql, { schema }) when schema size grows. Upgrade to drizzle-orm 0.28.0 to restore editor speed.

Read
143
Article·8 min read

Cannot access 'Player' before initialization: ESM cycle

A circular import makes a subclass run its extends clause before the base class module has finished. Break the cycle so the base imports nothing back.

Read
144
Article·8 min read

Unexpected any. Specify a different type: fix or disable

ESLint ignores // eslint config comments, so the OFF never applies. Use eslint-disable-next-line, a config override, or type the value as unknown.

Read
145
Article·8 min read

Prettier and ESLint Indent Rules Conflicting: the Fix

ESLint and Prettier implement indentation separately, so they can disagree. Disable the indent rule with eslint-config-prettier instead of tuning it.

Read
146
Article·8 min read

Fix: Jest SyntaxError Unexpected token export (uuid library)

Jest loads uuid dist/esm-browser/index.js, an ES module, and chokes on export. Map uuid to its CJS build, or upgrade to uuid 9.

Read
147
Article·7 min read

drizzle-kit: Cannot use import statement outside a module

drizzle-kit 0.31.9 and older load your schema as CommonJS, so an ES module it imports breaks on older Node. Upgrade to 0.31.10 or run it through tsx.

Read
148
Article·9 min read

Fix "only exports components": Fast Refresh ESLint error

ESLint's react-refresh rule fires on a component sitting next to a non-component export. Split the two into separate files to fix it.

Read
149
Article·9 min read

Fix: Do Not Use Array Index in Keys (React)

ESLint's react/no-array-index-key flags key={index}: removing or reordering list items can attach one row's state to another. Use a stable id instead.

Read
150
Article·8 min read

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

No TSConfig in parserOptions.project contains the .cy.ts file. List cypress/tsconfig.json in project, set tsconfigRootDir, or use projectService.

Read
151
Article·7 min read

drizzle-kit generate: Cannot find module .js under nodenext

drizzle-kit 0.31.9 and older resolve a .js import of a .ts schema file literally. Upgrade drizzle-kit, run it under tsx, or point schema at tsc output.

Read
152
Article·7 min read

Fix Cannot resolve symbol 'Routes': stale JetBrains typings

WebStorm, PyCharm or IntelliJ reads old react-router-dom 5 typings from its own cache. Remove the package from the Registry key, delete the cache.

Read
153
Article·12 min read

Fix: $VARIABLE is not listed as a dependency in turbo.json

The turbo/no-undeclared-env-vars ESLint rule fires until the variable is declared in turbo.json, or exempted by framework inference.

Read
154
Article·9 min read

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

ignores next to files only disables that block's rules, not the files — typescript-eslint's project service still parses them. Give ignores its own block.

Read
155
Article·9 min read

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

ESLint's default parser (Espree) can't read TypeScript's enum. Use @typescript-eslint/parser: languageOptions.parser in flat config, parser in .eslintrc.

Read
156
Article·7 min read

drizzle-kit/api: Dynamic require of "fs" is not supported

In drizzle-kit 0.x before 0.31.6, api.mjs calls require() where an ES module has none, so importing pushSchema throws. Upgrade, or use createRequire.

Read
157
Article·8 min read

Fix ESLint: Module.createRequire is not a function

ESLint 7/8 calls Module.createRequire at startup. Below Node v12.2.0 it does not exist, usually because your editor runs an older Node than your terminal.

Read

Type patterns & operators

4 items