[dev-server] React + Typescript: Uncaught ReferenceError: process is not defined
I have tried to use the example in example-projects with React Router.
I have cloned the example, installed react-router-dom and used it in App.tsx.
When running the server and navigating to /demo/ it fails with: Uncaught ReferenceError: process is not defined
I have created a repository with the problem: https://github.com/theisgroenbech/web-dev-server-example/

Any ideas?
Put this before loading any javascript into your html file:
<script>
globalThis.process = { env: { NODE_ENV: 'development' } };
</script>
When bundling with rollup use @rollup/plugin-replace in order to remove development from your modules
See https://github.com/modernweb-dev/web/issues/1954#issuecomment-1285280464 for a working config using @rollup/plugin-replace to provide process.env.NODE_ENV.
Closing as this is not a bug. We could consider updating example projects accordingly, though.