Running npm dev
is not showing any errors for missing names.
To replicate the issue, follow these steps:
Create a React/TypeScript application named "foobar" by running:
$ npm create vite@latest Need to install the following packages: [email protected] Ok to proceed? (y) y ✔ Project name: … foobar ✔ Select a framework: › React ✔ Select a variant: › TypeScript
Navigate into the project directory and install packages
cd foobar && npm i
Edit the file
src/main.tsx
and add a non-existent function call:import { StrictMode } from 'react' import { createRoot } from 'react-dom/client' import App from './App.tsx' import './index.css' does_not_exist(); createRoot(document.getElementById('root')!).render( <StrictMode> <App /> </StrictMode>, )
Outcome:
npm run dev
does not flag the missing does_not_exist
function. However, npm run build
catches it. I prefer using npm run dev
during development as it recompiles on file changes.