Skip to main content
Filter by
Sorted by
Tagged with
190 votes
18 answers
392k views

I want to load environment variables from the .env file using Vite I used the import.meta.env object as mentioned in Docs .env file: TEST_VAR=123F when trying to access this variable via the import....
Mohamed Fadl's user avatar
  • 2,229
169 votes
30 answers
521k views

I'm using Node.js and npm for the first time, I'm trying to get Vite working, following the tutorials and documentation. But every time I run into the problem: 'vite' is not recognized as an internal ...
MaN8fy's user avatar
  • 1,765
157 votes
3 answers
83k views

I'm using Vite to create a new React + TypeScript project. After creating the project, there are two TypeScript config files on the root folder: tsconfig.json and tsconfig.node.json. These are the ...
rodrigocfd's user avatar
  • 8,379
155 votes
20 answers
85k views

Trying to setup vitest on an already existing vite (vue 3, typescript) project. My vite.config.ts looks like this: import { defineConfig } from 'vite'; import vue from '@vitejs/plugin-vue'; export ...
WillD's user avatar
  • 6,842
108 votes
15 answers
125k views

I'm struggling to get absolute path to work in a Vite react-ts project. Here's how I created the project npm init @vitejs/app npx: installed 6 in 1.883s √ Project name: ... test-vite √ Select a ...
Alex Monkey's user avatar
  • 2,106
100 votes
25 answers
178k views

I installed a package called big decimal js while using React with JavaScript on Vite. On compiling, it showed the following error on the console, and the application did not load: My package.json: { ...
Vedant Shah's user avatar
  • 1,484
94 votes
8 answers
234k views

I am using Vite (https://vitejs.dev/) for a static multipage site. This is the default project folder structure after the build command. my-app/ ├─ node_modules/ ├─ dist/ │ ├─ assets/ │ ├─ index....
Shams Sujon's user avatar
87 votes
21 answers
140k views

Tried to use this library: vite-plugin-react-svg and had no success by importing it like: import { ExternalLink } from 'assets/svg/link-external.svg?component'; Are there any workarounds for this ...
Gabriel Nadaleti's user avatar
78 votes
18 answers
116k views

I'm using Vue 3 with Vite. And I have a problem with dynamic img src after Vite build for production. For static img src there's no problem. <img src="/src/assets/images/my-image.png" alt=...
Ondrej Vencovsky's user avatar
75 votes
11 answers
63k views

With create-react-app one could use process.env.REACT_APP_VERSION for this. Is there an equivalent in Vite?
Obiwahn's user avatar
  • 3,167
73 votes
8 answers
79k views

When Jest.js encounters import.meta in the code, I get an error: FAIL testFile.test.ts ● Test suite failed to run testFile.ts:40:10 - error TS1343: The 'import.meta' meta-property is only ...
Sean D's user avatar
  • 4,392
70 votes
14 answers
148k views

Trying to build a simple Vite project that has tailwindcss in it and getting the following error, any ideas? > [email protected] build > vite build vite v2.3.4 building for production... ✓ 1 ...
James Mansfield's user avatar
68 votes
5 answers
54k views

I try to build my project in vite, my project - https://github.com/yakovcohen4/starbucks-openlayers I run npm run dev and all work. but when I run to build it I get an error. error message: Top-level ...
yakov's user avatar
  • 883
63 votes
22 answers
192k views

I'm working on a project that is using laravel 9 and Vite with laravel-vite, In the Dev environment everything works fine, but in production on the cPanel server I have the following issue: Vite ...
sos5020's user avatar
  • 849
62 votes
7 answers
52k views

I have a vue3 project using Vite/Vitest, as recommanded in Vue.js documentation. Here is the structure of the project: src components // my Vue components here, potentially in sub-folders. For ...
Eria's user avatar
  • 3,253
52 votes
15 answers
76k views

I'm creating a project using Vite with vanilla-ts, at one point I had to use the readdir method from the fs-extra package, but it created an error saying process is not defined, some suggested I place ...
8BitSoda's user avatar
  • 588
52 votes
8 answers
82k views

I switched from the Vue CLI to Vite CLI, and from the Composition API of Vue 3 to SFC Script setup API. How it previously worked for me When I was using the official Vue CLI, I could import an image ...
Dony's user avatar
  • 2,029
49 votes
7 answers
78k views

I am using Vite to statically compile my React app. However, after building, .env imports become undefined, which is not the case at the development stage. Reading the docs, I've found out that these ...
vexingCoder's user avatar
48 votes
10 answers
95k views

I'm having a devil of a time figuring out how to build a single .js file from Vite in my Svelte project that includes all of the built javascript and CSS from my Svelte projects. By default, Vite ...
ringmaster's user avatar
  • 3,429
45 votes
8 answers
114k views

I starting with vite / vuejs 3 after installing sass with npm install -D sass I tried to add my _variables.js file this to vite.config.js css: {preprocessorOptions: {scss: {additionalData: `@import&...
bluelemonade's user avatar
  • 1,345
43 votes
30 answers
152k views

Vite + Reactjs server is running but I am getting "This localhost page can’t be found No webpage was found for the web address: https://localhost:4200/" on the browser
Muhammad Raheel's user avatar
40 votes
5 answers
36k views

I have a project created with create-react-app with Typescript. And I am using yarn 3.3.0 as the package manager. Now I am trying to shift from cras webpack to vite. I have bootstrapped a project with ...
Nahidujjaman Hridoy's user avatar
38 votes
8 answers
46k views

Buffer is not defined after migrating from CRA(create react app) "vite": "^2.7.12" I try to add plugins, add define for Buffer, but it's not work. const viteConfig = defineConfig({...
Николай Сычев's user avatar
37 votes
5 answers
66k views

I have a Vue-cli app that I'm trying to convert to vite. I am using Docker to run the server. I looked at a couple tutorials and got vite to run in development mode without errors. However, the ...
Paulie's user avatar
  • 2,512
36 votes
3 answers
67k views

I have a Vue2 project with Webpack, and I'm trying to switch from Webpack to Vite. In webpack.common.js, I have multiple entry points: module.exports = { entry: { appSchool: './resources/...
Lirrr's user avatar
  • 547

1
2 3 4 5
140