The browser esbuild config doesn't like node-stuff that's only used for server stuff. Here's the output of the build:
Building Remix app in production mode...
> node_modules/cache-manager/lib/caching.js:28:21: warning: This call to "require" will not be bundled because the argument is not a string literal (surround with a try/catch to silence this warning)
28 self.store = require('./stores/' + storeName +...
~~~~~~~
> node_modules/cache-manager/lib/caching.js:28:21: warning: This call to "require" will not be bundled because the argument is not a string literal (surround with a try/catch to silence this warning)
28 self.store = require('./stores/' + storeName +...
~~~~~~~
Built in 98ms
Doesn't matter what the module is. The point is, if it's doing stuff that can't be compiled for a browser build, esbuild isn't happy with it regardless of whether that code will make it to the browser build or not.
Welcome to Remix!
This is a starter repo for using Remix with Express.
After cloning the repo, rename .npmrc.example
to .npmrc
and insert the license key you get from logging in to your dashboard at remix.run.
Note: if this is a public repo, you'll probably want to move the line with your key into
~/.npmrc
to keep it private.
Then, install all dependencies using npm
:
$ npm install
Your @remix-run/*
dependencies will come from the Remix package registry.
Once everything is installed, start the app in development mode with the following command:
$ npm run dev
This will run a few processes concurrently that will dynamically rebuild as your source files change. To see your changes, refresh the browser.
Note: Hot module reloading is coming soon, which will allow you to see your changes without refreshing.
To run the app in production mode, you'll need to build it first.
$ npm run build
$ npm start
This will start a single HTTP server process that will serve the app from the files generated in the build step.
Detailed documentation for Remix is available at remix.run.
All application source code is found in the app
directory. This includes your application entry points for both server rendering (see app/entry.server.tsx
) and the browser (see app/entry.client.tsx
), as well as your root component and routes (see app/root.tsx
and app/routes
).
Everything in the public
directory is served by express.static
.
The no-typescript
branch is a version of this same starter template that uses plain JavaScript instead of TypeScript for all code in app
.