/testing-vite-super-ssr

Primary LanguageTypeScriptMIT LicenseMIT

Vite logo React logo

⚡ vite-super-ssr template


This template repo tries to achieve the minimum viable example for a modern front-end application

The list of features:


Commands

// build development
yarn start 

// build development client only
yarn start:client

// build production
yarn build

Troubleshooting

Requests are stalled forever (vite docs link)

If you are using Linux, file descriptor limits and inotify limits may be causing the issue. As Vite does not bundle most of the files, browsers may request many files which require many file descriptors, going over the limit.

To solve this:

  • Increase file descriptor limit by ulimit

    # Check current limit
    $ ulimit -Sn
    # Change limit (temporary)
    $ ulimit -Sn 10000 # You might need to change the hard limit too
    # Restart your browser
  • Increase the following inotify related limits by sysctl

    # Check current limits
    $ sysctl fs.inotify
    # Change limits (temporary)
    $ sudo sysctl fs.inotify.max_queued_events=16384
    $ sudo sysctl fs.inotify.max_user_instances=8192
    $ sudo sysctl fs.inotify.max_user_watches=524288

P.S.

Feel free to customize the template. You can easily remove any feature you want and add your own ✌️