How to fix the ReferenceError: global is not defined error in SvelteKit/Vite

This page summarizes the projects mentioned and recommended in the original post on dev.to

SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
  • vite

    Next generation frontend tooling. It's fast!

    SvelteKit uses Vite as its build tool which is great because Vite pre-bundles dependencies using esbuild which is really really fast. But by default, Vite doesn't include shims for NodeJS variables so these need to be added by the user.

  • SaaSHub

    SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives

    SaaSHub logo
  • Dragula

    :ok_hand: Drag and drop so simple it hurts

    https://github.com/vitejs/vite/issues/2778 https://github.com/vitejs/vite/issues/728 https://github.com/bevacqua/dragula/issues/602 https://kit.svelte.dev/faq#aliases

  • SvelteKit

    web development, streamlined (by sveltejs)

    I spent hours trying to figure this out and it was really difficult to find the exact information on the web since this error message is very similar to an Angular issue. However, the Angular solution is useless for SvelteKit so, I thought I'd put this post together.

  • esbuild

    An extremely fast bundler for the web

    SvelteKit uses Vite as its build tool which is great because Vite pre-bundles dependencies using esbuild which is really really fast. But by default, Vite doesn't include shims for NodeJS variables so these need to be added by the user.

  • Angular

    Deliver web apps with confidence 🚀

    I spent hours trying to figure this out and it was really difficult to find the exact information on the web since this error message is very similar to an Angular issue. However, the Angular solution is useless for SvelteKit so, I thought I'd put this post together.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

  • Make your Vite applications run a little faster

    12 projects | dev.to | 14 Sep 2024
  • React with Vite On Steroids

    11 projects | dev.to | 13 Aug 2024
  • Oh CommonJS! Why are you mESMing with me?! Reasons to ditch CommonJS

    3 projects | dev.to | 12 Jul 2024
  • Show HN: I made a programmable computer from NAND gates

    3 projects | news.ycombinator.com | 25 Apr 2024
  • Vitest In-Source Testing for SFC in Vue?

    3 projects | dev.to | 16 Apr 2024

Did you konow that JavaScript is
the 3rd most popular programming language
based on number of metions?