Category "javascript"

Modifying a copy of a JavaScript object is causing the original object to change

I am copying objA to objB const objA = { prop: 1 }, const objB = objA; objB.prop = 2; console.log(objA.prop); // logs 2 instead of 1 same problem for Arrays

Encoding issue when saving files with javascript?

i've been trying all day to setup a function that creates a file from plaintext or a stream in a razor page. i create csv plaintext in a backend and send it to

I am having this " throw new RangeError('BITFIELD_INVALID', bit);" error; and i just can not find the solution

I keep getting this error: throw new RangeError('BITFIELD_INVALID', bit); ^ RangeError [BITFIELD_INVALID]: Invalid bitfield flag or number: undefin

Android Pre-launch test Crash due to androidx.test.espresso.web.sugar.Web$WebInteraction.doEval execption

It happens when the Robotest tries to load Google Webpages into the Webview of the App. Specifically for Samsung Device SM-G960U1, SDK 8, API Level 26. Fatal ex

Modal always re-rendering when typing in input for React-Bootstrap-Table2

I'm trying to implement an 'Edit Category' modal that can edit the current selected row in React-Bootstrap-Table2. However, when I tried to type in Category Des

vite.config.js rollupOptions leads to "Unexpected token" error during build

I am currently trying to switch my laravel project from laravel-mix to something like Vitejs. I followed the tutorial available here: https://owenconti.com/post

inside a script module, try to import js files with twig asset() (error: myalias.x is not a function)

[ Environment: symfony (PHP), twig files with HTML/JS code, and Managing assets with Webpack ] Files Tree _assets |__js |__file.js |__library |_

react-bootstrap-table-toolkit Search Import Error

I wanted to use React Bootstrap Table in my project and I'm getting the following error. Uncaught ReferenceError: arguments is not defined at Object../node_mod

How can I use backslashes (\) in a string?

I tried many ways to get a single backslash from an executed (I don't mean an input from html). I can get special characters as tab, new line and many others

Laravel Sanctum Vue

I have some problems authenticating an user with Laravel Sanctum. I have installed everything as needed, with Vite and Vue 3 as a frontend. So here is the probl

Specifying a port in MongoDB URI does not allow me to connect to my local DB

I am testing a connection to a local DB using mongoose and mongodb. Whenever I specify a port when passing in the URI to mongoose.connect() I get a connection r

How to correctly store user secrets in a frontend Application?

I am building a Web Application where the user's data is end-to-end-encrypted. The web client obviously needs a secret that nobody else knows for end-to-end-enc

How do I generate a UUID in SAP UI5 code? [duplicate]

I know how to do that in node.js, with npm-managed libraries like uuid. But what's a decent way to do this in browser-based SAP UI5 JavaScript

Set new intiial SlateJS editor value with React onEffect

How to easily set entire SlateJS editor value using React onEffect hook? The initial editor value is set when creating the useState hook, however, I want to set

When working with the native mongoDB driver, Node.js and hyper terminal, I receive an error saying "TypeError: Cannot read property 'n' of undefined"

I am using vs-code, hyper-terminal (Git Bash), JavaScript, Node.js, Express, MongoDB and its native driver but while I finished up writing my code, I wrote node

Can I add a function with the (click) event to my span tags that I added with the replace method?

https://i.stack.imgur.com/B5doW.png I have sentences like this, and as you can see, if the word I'm looking for is in that sentence, I put it in span tags. .rep

Include JSON files into React build

I know this question maybe exist in stack overflow but I didn't get any good answers, and I hope in 2020 there is better solution. In my react app I have a con

How to set conditional rules and required fields in vue?

I am trying to make few fields conditionally required. But I am not able to make it work. I have set a data field notRequired: false and based on that I am usin

Ng serve throwing @angular/core/core has no exported member 'ɵɵFactoryDeclaration'

I'm getting errors stating that angular/core/core has no exported member 'ɵɵFactoryDeclaration' while I ran ng serve on angular9 project. The error I

How to set conditional rules and required fields in vue?

I am trying to make few fields conditionally required. But I am not able to make it work. I have set a data field notRequired: false and based on that I am usin