Questions tagged [vite]
For questions about using Vite, a two-part build tool (dev server + build command) that aims to provide a faster and leaner development experience for modern web projects.
6,605
questions
0
votes
1
answer
13
views
RollupError: Module format "umd" does not support top-level await. Use the "es" or "system" output formats rather
RollupError: Module format "umd" does not support top-level await. Use the "es" or "system" output formats rather.
I can't figure out what to do. I'm trying to build my ...
0
votes
0
answers
5
views
Unable to open extension by event
I am trying to make a browser extention using vite
import {listAllAccounts } from './storage';
import { useNavigate } from "react-router-dom";
chrome.runtime.onMessage.addListener((request, ...
-1
votes
1
answer
17
views
How to add simple JSON API to Vite?
I just need to return simple JSON response for /api/status: { "ok": true }.
Something like:
import { defineConfig } from 'vite'
export default defineConfig({
server: {
route: ('/api/...
-1
votes
0
answers
19
views
Laravel error handling for authentication system
I want to implement the laravel build in authentication system breeze in my laravel project. But when I clicked on the login or register the css is not working and also it shows a error.
Mix manifest ...
1
vote
0
answers
11
views
i use Vuexy template that is build on vite vue3 and vuetify and i use pinia store, i want to add SSR to my project
the problem is that i get errors in localStorage and window being undefined in all my pages like themes, plugins and etc
and my project is considered as a middle-large sized one so i can't update my ...
-2
votes
0
answers
20
views
How do deploy vite ssr react app on server?
I have a problem with the deployment of Vite SSR React assembly on Vercel. Here is the Github repository of the Vite template on which I have a project
https://github.com/bluwy/create-vite-extra/tree/...
1
vote
1
answer
20
views
Bulding with Vite - Fetch (or paths) not working
I have a simple client-side page, made with React using Vite.
The project worked perfectly when running localy (npm run dev), but after running npm run build, a dist folder is created and that's the ...
-2
votes
0
answers
15
views
config eslint to follow Airbnb style in ReactJS Typescripts
I want to use Airbnb as eslist style but unfortunately with the newer version of @eslint/create-config, it only supports flat system. I'm not good at eslint configuration. Is there any luck to config ...
0
votes
0
answers
14
views
Error: Cannot set properties of undefined (setting 'mode') vercel deployment laravel
I want to deploy using vercel through the CLI and when I run vercel build everything is safe until npm run build then not long ago it appears the error setting 'mode' I don't know where the error is ...
0
votes
0
answers
14
views
How to resolve 'Cannot find module' and 'noEmit' issues in TypeScript project with Vite?
Cannot find module: I'm encountering an error I Cannot find module @/lib/utils even though I have configured path aliases in both tsconfig.json and vite.config.ts. It seems like TypeScript or Vite isn'...
0
votes
0
answers
23
views
How to Implement GlideJS in Laravel Vite
I want to implement GlideJS with Vold in Laravel Vite. GlideJS can work well when the page is reloaded, but GlideJS doesn't work when moving pages by hot reloading using Volt. Here is the code I have ...
0
votes
0
answers
17
views
In Vite-based React project, what is the recommended way to enable or disable <Profile> component?
The React doc on Profiler says the following:
Pitfall
Profiling adds some additional overhead, so it is disabled in the production build by default. To opt into production profiling, you need to ...
0
votes
1
answer
13
views
Vitest not properly interpreting TypeScript
I have the following setup test:
import { describe, it } from "vitest";
import { init, initServer } from "../src";
import dotenv from "dotenv";
dotenv.config();
...
1
vote
0
answers
4
views
Alternatives to libInjectCss from vite-plugin-lib-inject-css
I'm on the process of building a Vite application and I can see that the build generates three files which are significantly big.
myProject.js 37kb
myProject.umd.js 3671kb
main.css 3657kb
This is ...
0
votes
1
answer
19
views
Laravel vite : get the versioned url of my JavaScript file
with laravel vite, how can i get the versioned url of my javascript file.
Do you have any ideas for implementing any specific versioning for my project.
-1
votes
0
answers
41
views
Cannot read properties of undefined (reading 'Vue') at initBackend, how can i solve this error?
I’m working on a Vue 3 application using Pinia for state management, and I’m encountering an issue where added messages are not rendering on the screen. Additionally, I’m getting a persistent error in ...
0
votes
0
answers
12
views
Migrating from CRA to Vite: Uncaught TypeError: Unable to determine current node version
Migrating from CRA to Vite for a react project. After running the vite project, it displays a blank page. There's a console error:
Uncaught TypeError: Unable to determine current node version
at ...
0
votes
0
answers
37
views
Unexpected early exit. This happens when Promises returned by plugins cannot resolve. (Vite.js)
Whenever I try to build my vite.js project, it keeps throwing this error:
Unexpected early exit. This happens when Promises returned by plugins cannot resolve.
...
...
at process.handleBeforeExit (...
0
votes
1
answer
36
views
Issue with React's createRoot Function
I'm encountering an issue with React's createRoot function in my project. When I attempt to use ReactDOM.createRoot(document.getElementById('root')).render(<App />);, I receive the following ...
0
votes
0
answers
20
views
Bundle single static .mjs file without any modules using Vite
I am building a vanilla TS SPA that is using Vite as the build tool. For my main app, I have a index.html with a script tag pointing to the entry point .ts file, and that all works great.
However, I ...
0
votes
0
answers
34
views
How to add `tailwindcss` to my Vue + Electron Forge project?
I'm doing my first sample project using Vue + Electron Forge with the template vite+typescript. Now I want to add tailwind but I can't seem to find any useful documentation online.
This is my project ...
0
votes
0
answers
23
views
"npm run dev" works in Git Bash but not in PowerShell
I'm experiencing an issue where the command npm run dev works perfectly in Git Bash but fails to execute in PowerShell. Here are the details of my setup and the steps I've taken:
My Setup:
Operating ...
0
votes
0
answers
12
views
Failed to resolve vue/compiler-sfc when I try to install Caldera
I try to install Caldera by following the steps explained on this link https://caldera.readthedocs.io/en/latest/Installing-Caldera.html
I succeed to install every package on the file requirements.txt ...
-3
votes
0
answers
24
views
Need some help for my project using React+GSAP Flip [closed]
I've been trying to recreate a CodePen project that I saw the other day. Here is the CodePen project that I am trying to replicate.(https://codepen.io/cmalven/pen/RwGqewd?editors=0110)
<div class='...
0
votes
0
answers
61
views
How do I work with a large (~3gb) file in web assembly
A bit of background:
I would like to avoid using stdweb, because it seems to be unmaintained.
use web_sys::{File as WebFile};
// What I get
pub fn process_emails(file: WebFile, json_file_path: &...
1
vote
0
answers
32
views
Vite Error : FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
I'm encountering a "JavaScript heap out of memory" error when running npm run build on my Node.js project. The build process works fine during development (npm run dev), but it fails during ...
0
votes
1
answer
45
views
HTTPS Application Loading Insecure Font from HTTP Cache Despite Different Configurations
I have two applications running on the same port (5173). One application uses HTTP and includes a font (YoungSerif-Regular.ttf), and the other uses HTTPS and does not include this font. When I turn ...
-2
votes
1
answer
20
views
useCollapse not callable | Type 'typeof import ("home/.../node_modules/react-collapsed/dist/index")' has no call signatures
I am trying to use the recat-collapse component but is throws this error:
This expression is not callable.
Type 'typeof import("/home/user/Dokumente/iGem/Wiki/bielefeld-cebitec/node_modules/...
0
votes
0
answers
17
views
React | aos | node | Unknown file extension ".css" for /home/user/.../aos/dist/aos.css with
I am trying to use aos on a website based on React.
Here is the component I created according to https://getisotope.com/post/react-aos:
//AOSs.tsx
import AOS from "aos";
import "aos/...
-3
votes
0
answers
20
views
Need help in integrating Scandit barcode scanner in React Js project [closed]
working fine when i create project using create react app but not when creating using vite
Uncaught SyntaxError: The requested module '/node_modules/scandit-sdk/build/module/styles/styles.scss' does ...
-1
votes
1
answer
38
views
react-router-dom issue with Vite react
I'm setting up react-router-dom in my Vite react app. Everything is running smoothly in dev, but when I rub my build and preview it, Im getting the following error
localhost/:1 Uncaught TypeError: ...
0
votes
1
answer
34
views
Is it possible to make a contentEditable div have a fixed height in React.js?
I have this contentEditable div and I need it to have a fixed size/capacity. The div should not keep making new lines if it reaches the capacity and the user shouldn't be able to keep typing in the ...
1
vote
0
answers
46
views
How to handle client-side validation with AES-GCM encrypted cookies?
Currently, I am trying to find a way to keep users on my site logged in and redirect them to the login page if they are not. I am using React + Tsx and React Router Dom for my frontend, and a Golang ...
1
vote
0
answers
20
views
Getting 404 error when reloading page using Firebase Hosting
I have an react + vite project hosted on Firebase Hosting
Previously after i deployed changes to hosting, i had and error in console:
Failed to load module script: Expected a JavaScript module script ...
0
votes
0
answers
19
views
Is it redundant to have a function to load all the file not in the dist folder in a Vite React Project?
Before I say what the problem is could I get some links to some resources that help me understand how Vite build files and how the whole build process works? Especially when it comes to the asset ...
0
votes
1
answer
30
views
Chrome Extension + React + Vite Build in different folders
I'm trying to build a Chrome Extension with react and vite.
I have an App within the main folder "src" main.jsx and App.jsx. But i want another jsx file in a subfolder to be build in the ...
1
vote
0
answers
22
views
App threw an error during loadReferenceError: __dirname is not defined in ES module scope
I'm trying to build desktop app using Electron JS + React JS + Vite by using command (npm i electron-vite@latest)
It works fine, now there is a need to communicate to serialport, so installed (npm i ...
0
votes
0
answers
13
views
Electron Forge with Vue 3 integration doesn't work
i want develop an Electron app integrated with Vue 3 using electron forge.
I've followed this official documentation
Electron Vue integration .
But when i run the command
npm start
the application ...
0
votes
1
answer
30
views
Rollup: Merge a split chunk back into the entrypoint
I have a module with a good handful of chunks A, B, C, and D, all of which rely on a shared utilities file which Rollup separately chunks.
Because this utilities file is only a couple of Kb, and ...
0
votes
0
answers
26
views
Module "http" has been externalized for browser compatibility. Cannot access "http.METHODS" in client code
I am following a yotube tutorial on how to make a twitter clone and I understand almost everything.
However, I am encountering an error like this express.js?v=2bb3381c:1288 Module "fs" has ...
-2
votes
0
answers
60
views
My entire page reloads after changing a state in react
So I have a website with a global state that I created using redux. This holds a list of every window there is. I have seperate state for the windows itself to track it's position and size on the ...
0
votes
0
answers
22
views
REACT-VITE-DOCKER ERROR: Could not resolve entry module "index.html". error during build: RollupError: Could not resolve entry module "index.html"
Im migrating my existing React-Vite app into a docker container, but I keep getting this error when running the docker build command:
\> [email protected] postinstall > npm run build > vite-...
0
votes
0
answers
18
views
Vite compiled file fails with error during namespace mapping
I have a node.js app that I want to build with Vite/SWC.
Config file:
import { defineConfig } from 'vite';
import { VitePluginNode } from 'vite-plugin-node';
import path from 'path';
export default ...
1
vote
2
answers
43k
views
Is it true to have the index-xxxx,js/css files are necessary to force the cache to clear?
So I've been told by the project manager of this project I'm volunteering for that keeping names for files like index-xxxx.js will help to force the cache to clear if we use them in like the root ...
0
votes
1
answer
44
views
Can Vite be used with React 16? And is it worth it? [closed]
Basically that. I have a React 16 CRA app that I would like to upgrade to Vite, however, since it is not my own app, I cannot upgrade the React version to 17 or 18.
Is it possible and/or worth the ...
0
votes
1
answer
11
views
backend dependency within Svelte component library gets imported on SvelteKit (Vite/Rollup) build
I created a Svelte component library which uses better-sqlite3 for some backend methods.
When building an app which uses this custom library, better-sqlite3 gets imported and bundled, causing issues ...
-1
votes
1
answer
44
views
How do I define a type which is already available globally?
I am using react with vite.js, I have typescript setup too, I have installed Jimp which is mainly made for node.js but has a minified script that you can load, I have loaded it in main.jsx like this:
....
1
vote
2
answers
50
views
Why is Vue's Composable not Isolated?
I'm using Vue 3 with Nuxt 3 and Vite, and I'm encountering a strange bug. It occurs almost everywhere in my app whenever I try to use useFetch within a composable.
For example, I have the following ...
0
votes
2
answers
136
views
How can I solve the issue of 'failed to resolve import "primevue/datepicker"'
enter image description here
I want to use the package in Vue JS - DatePicker from Primevue
The documentation says that you need to install the package using the command - npm install [email protected]...
0
votes
1
answer
81
views
this in an IIFE is undefined when building with vite
I have tried to migrate a CRA to vite. One remaining obstacle is a dependency of a dependency that has this code:
var requestFrame = (function () {
var window = this
var raf = window....