Hang on, you can’t upvote just yet. You’ll need to complete a few actions and gain 15 reputation points before being able to upvote
Category: javascript
Category Added in a WPeMatico Campaign
Why in D365 Handler of properties Im getting the following error formContext.getAttribute is not a function?
I have the following TypeScript function. It’s successfully hiding the test1 field on form load, as I’m calling the function on load and passing the execution context in a Dynamics CRM form.
However, I’m trying to achieve the following behaviour: when the testisCompleted field is changed to “Yes”, I want to show the header_process_test1date field. The issue I’m facing is that when the onChange event fires, I get an error saying: formContext.getAttribute is not a function
Could anyone help me understand why this is happening and how to fix it? Thanks in advance!
export function onContractPrepStage(executionContext: Xrm.Events.EventContext) {
const formContext = executionContext.getFormContext();
const testisCompleted = formContext.getAttribute("test1")?.getValue();
const ctrl = formContext.getControl<Xrm.Controls.OptionSetControl>("header_process_test1date");
if (testisCompleted) {
ctrl?.setVisible(true);
} else {
ctrl?.setVisible(false);
}
}
handleAuth is not a function with @auth0/nextjs-auth0 v4.x in Next.js App Router / Pages Router
I am trying to integrate Auth0 authentication in a Next.js project using the official @auth0/nextjs-auth0 package (v4.7.0).
I carefully followed both the official documentation and several community guides.
I tried both of these setups:
- Using the App Router, created src/app/api/auth/[…auth0]/route.ts.
- Used the documented import:
import { handleAuth } from '@auth0/nextjs-auth0'; export const GET = handleAuth(); export const POST = handleAuth();
-
Result: Always get TypeError: handleAuth is not a function or Module ‘”@auth0/nextjs-auth0″‘ has no exported member ‘handleAuth’.
-
Using the Pages Router; vreated /pages/api/auth/[…auth0].ts (and tried .js as well)
Tried both
import { handleAuth } and const { handleAuth } = require(...)
- Result:
If using import, Next.js throws “Module parse failed: ‘import’ and ‘export’ may appear only with ‘sourceType: module’”.
If using require, I get Module not found: ESM packages (@auth0/nextjs-auth0) need to be imported.
I also tried multiple package versions (e.g., 2.x, 4.7.0, 4.0.0), cleaning node_modules, deleting lock files, and using both JS and TS files, but always end up with either a 404, 500, or the above TypeErrors.
To be able to use Auth0’s handleAuth in either App Router or Pages Router as shown in the docs, and get a working authentication endpoint .
Why does Parcel intermittently fail to recognize modules or .env variables in my React project?
I’m using Parcel in a React project, and I’m running into frequent and inconsistent build issues.
The project works fine one moment, but after making a small change (like importing a hook or updating a file), Parcel suddenly throws errors such as:
Cannot find module ‘react’ – even though react is installed and present in node_modules
.env variables like process.env.BEARER_TOKEN return undefined, even though the exact same code was working before
Some examples:
I added useEffect from “react” and Parcel failed to recognize the react module, breaking the build
I used process.env.BEARER_TOKEN in my API call – initially it worked, then suddenly it broke and returned undefined; when I hardcoded the token, it worked again. But later, without any changes, process.env.BEARER_TOKEN started working fine again
Occasionally, Parcel fails to rebuild unless I:
Delete .parcel-cache
Delete and reinstall node_modules
My setup:
Parcel version: ^2.15.2
React version: 19.1.0
OS: Microsoft Windows [Version 10.0.26100.4351]
My .env file (at project root):
BEARER_TOKEN=yuJhbG… (no quotes or spaces) [this is just example token]
My API options in code:
export const API_OPTIONS = {
method: ‘GET’,
headers: {
accept: ‘application/json’,
Authorization: Bearer ${process.env.BEARER_TOKEN?.trim()},
},
};
What I’ve tried:
Restarting Parcel dev server (npx parcel index.html)
Deleting .parcel-cache
Reinstalling node_modules
Restarting my IDE (VS Code)
Confirmed .env is correctly formatted and at the root
Ensuring I’m not using stale cached tokens or module imports
My question:
Why is Parcel behaving so inconsistently with module resolution and .env variables?
Is this expected behavior? Is there a known issue with Parcel’s caching or environment variable injection?
How can I make my development environment more stable and predictable?
Any insights or best practices for working with Parcel in React projects would be appreciated!
Shortlink bypass [closed]
I want to install a big count of files from ‘X1’ site, but it redirecting me on rplinks.in, rplinks to ‘X2’, ‘X2’ to google search of ‘X2’ site, where you need to click on ‘X2’ link, then click the button, wait a few time, scroll down, click and wait again, redirect to next step and repeat, 3 steps at all. And only then redirect on ‘X3’ site where without smth like token that’s just a normal studying site, but with it its redirect on drive with file (mediafire, mega.nz, etc.) That’s too long to install 40+ files like that, but there’s no browser extensions/scripts to bypass it, i don’t understand js and i need someone to create it, please!
X1 – impervert.com (yes, i want to install h games :))
X2 – It changes constantly, but right now for example this gplinks.co, used to be mewsr.com and techstadify.com
X3 – sorry, i don’t remember 🙁
Chrome extension error for non-existent inline event handlers?
I’m making a chrome extension and I’m honestly just confused now.
So I have an index.html file, a script.js file and a manifest.json file.
For whatever reason, Chrome seems to have a problem with line 5 of index.html. Always.
Here’s the contents of all 3 files:
manifest.json
{
"name": "Desmos import",
"description": "Import Desmos graphs through text.",
"version": "1.0",
"manifest_version": 3,
"permissions": ["activeTab","scripting"],
"action": {
"default_popup": "index.html"
}
}
index.html
<!DOCTYPE html>
<html>
<body>
<textarea id="input"></textarea>
<br>
<button id="importbutton">Import</button>
</body>
<script src="script.js"></script>
</html>
script.js
document.getElementById("importbutton").addEventListener("click", importtext);
function importtext() {
console.log("something");
}
Even when that line is replaced with something else (like a simple
), it still gives me an error on line 5 specifically. It even errors on that line if the file isn’t even 5 lines long.
The error seems to be one of those “inline event handlers aren’t allowed” errors, but I have no inline events anywhere, the script.js file contains all the scripts.
I’m starting to feel like this is all a bug on Chrome’s side but maybe I can use a hash or nonce or something to workaround it.
Thanks in advance for any help!
Signature invalid with AATL Certificate
I have working code/pdf if I trust a self-signed certificate. Moving to an AATL Certificate, I added the EE and Intermediate certificate to the pkcs7. The digital signature still comes out as Invalid in Acrobat. Here is the file.
VS Code not recognizing .vue file language — shows “Code language not supported or defined”
I’m working on a Vue 3 project in Visual Studio Code on Windows. Even though I’ve installed the Vue – Official extension (from Vue), VS Code keeps showing this error in the status bar when I open a .vue file:
Code language not supported or defined.
this is the program that i’m trying to run for now:
<script>
</script>
<template>
<h1>Vue Starter Page</h1>
<div class="main-info">
<p>
This is a sample starter Vue component. This component will be deleted during your exercise.
</p>
</div>
</template>
<style scoped></style>
I’ve tried the following:
-
Reinstalled VS Code completely (deleted User settings too)
-
Installed Vue – Official extension (the one maintained by Vue)
-
Also tried Vue 3 Snippets, Volar, and related language support extensions
-
Opened the folder properly using “Open Folder” (not just file)
-
Created or edited jsconfig.json and settings.json
-
Made sure the file has the correct .vue extension
-
Checked the status bar which shows the language as vue, but with a warning/error icon next to it
-
tried to configure the default formatter for Vue, but I don’t see Volar or any Vue formatters listed in the dropdown
still, nothing changes. Intellisense doesn’t work, syntax highlighting is inconsistent, and I can’t get any proper language support for .vue files.
is it a problem with the extension itself? is there potentially a problem with the configuration which might be blocking this?
what should I do?
Display inline image without knowing aspect ratio in React Native
I want an image, filling the width of the page, and some text below it.
It’s hard to believe this is impossible in react native without already knowing the aspect ratio.
Is there a solution that will work for images of any size?
My code:
import { View, Image, Text } from "react-native";
import monkey from "./public/attachments/charismatic_macaque.jpg";
export default function App() {
return (
<>
<View>
<Image source={monkey} style={STYLE_GOES_HERE} />
</View>
<Text>Caption directly below</Text>
</>
);
}
How to make JSON request for a Cinnamon DE Applet
recently I want to make applet that fetch and show this as notification
I checked linux mint documentation and some searches and built the applet code in JS metadata.json and applet.js
I tried to make something simple that fetch data when I click on applet icon but it doesn’t return anything
on_applet_clicked() {
let url = "https://api.alquran.cloud/v1/ayah/262/ar.alafasy";
Main.notify('Holy Quran', 'اختبار');
fetch(url)
.then((response) => response.json())
.then((json) => view(json));
function view(data){
var txt = data.data.text;
Main.notify('Holy Quran', txt);
}
}
I tested the same code in the browser and it return the data as I want but here is doesn’t
when I click on the icon no action happened and checking logs, reload the applet and nothing changes or see anything
tried Main.notify('Holy Quran', 'اختبار'); I thought it can’t render Arabic or something but this line works fine!

but the API respond not shown
my full code
const Applet = imports.ui.applet;
const Main = imports.ui.main;
function MyApplet(orientation, panel_height, instance_id) {
this._init(orientation, panel_height, instance_id);
}
MyApplet.prototype = {
__proto__: Applet.IconApplet.prototype,
_init(orientation, panel_height, instance_id) {
Applet.IconApplet.prototype._init.call(this, orientation, panel_height, instance_id);
this.set_applet_icon_name("force-exit");
this.set_applet_tooltip(_("Fetch & show Ayat al-Kursi"));
},
on_applet_clicked() {
let url = "https://api.alquran.cloud/v1/ayah/262/ar.alafasy";
Main.notify('Holy Quran', 'اختبار');
fetch(url)
.then((response) => response.json())
.then((json) => view(json));
function view(data){
var txt = data.data.text;
Main.notify('Holy Quran', txt);
}
}
};
function main(metadata, orientation, panel_height, instance_id) {
return new MyApplet(orientation, panel_height, instance_id);
}
I expect a notification with the data I fetched from the API
I tested the same code in the browser
let url = "https://api.alquran.cloud/v1/ayah/262/ar.alafasy";
var txt
fetch(url)
.then((response) => response.json())
.then((json) => view(json));
function view(data){
var txt = data.data.text;
console.log(txt);
}
and it return the data as I want but here is doesn’t
when I click on the icon no action happened and checking logs (no logs), reload the applet and nothing changes or see anything
tried Main.notify('Holy Quran', 'اختبار'); I thought it can’t render Arabic or something but this line works fine!

but the API respond not shown
my full code
const Applet = imports.ui.applet;
const Main = imports.ui.main;
function MyApplet(orientation, panel_height, instance_id) {
this._init(orientation, panel_height, instance_id);
}
MyApplet.prototype = {
__proto__: Applet.IconApplet.prototype,
_init(orientation, panel_height, instance_id) {
Applet.IconApplet.prototype._init.call(this, orientation, panel_height, instance_id);
this.set_applet_icon_name("force-exit");
this.set_applet_tooltip(_("Fetch & show Ayat al-Kursi"));
},
on_applet_clicked() {
let url = "https://api.alquran.cloud/v1/ayah/262/ar.alafasy";
Main.notify('Holy Quran', 'اختبار');
fetch(url)
.then((response) => response.json())
.then((json) => view(json));
function view(data){
var txt = data.data.text;
Main.notify('Holy Quran', txt);
}
}
};
function main(metadata, orientation, panel_height, instance_id) {
return new MyApplet(orientation, panel_height, instance_id);
}
Prevent form submission if incorrect value entered in textbos
I have a form that has a textbox where someone has to enter a correct code that was given to them. If the wrong value is entered, I want an alert to pop up that the code in incorret and the form submission to be disabled. The way I wrote it, the alert pops up, but when the alert window is closed, the person can go on with filling out the rest of the form and is able to submit it.
Any help would be appreciated, or a jquery solution as well. Thank you.
cdr6800
<script>
function checkCode() {
if (document.getElementById("compcode").value == "490023a"){
alert("You have entered the correct registration code, please proceed");
return true;
}else{
alert("You have entered the an incorrecct registration code, please try again");
return false;
}
}
</script>
How to Intercept Angular UI event at one place with / without Javascript?
I am using Angular 16 to design the UI and I have task to capture UI component event. Something like HttpInterceptor for http request at one place.
Do we have any way to write some Interceptor for UI as well so that when any UI event take place then I can write some logic where event end?
For me, I am OK to have this Interceptor either in Angular or JavaScript as well.
is there an API i can use to get cellular network signal strength data by location i.e. longitude and latitude
I am building a webapp where users can click on a location on a map (e.g., Google Maps), and based on the latitude and longitude of that click, I want to:
Query signal strength data for multiple mobile carriers (e.g., MTN, Airtel, Glo, etc.) at that specific location.
Compare the signal strength of each carrier and display which one has the best signal in that area.
I’ve Tried searching for crowdsourced solutions like
Open signal
Cell mapper
Sensorly etc
React Router changes URL but component doesn’t render — stays on same page
I’m working on a React version 19.1.0 + Vite version 6.3.5 project using react-router-dom version 7.6.3.
The problem is that the Link was not forwarding the user if the item was clicked. The URL changes, but it’s not loading. The page loads if you manually enter the URL and load it in the local environment. But if in production, it returns a 404 not found error. I’m going crazy
App.jsx
function App() {
return (
<GenreProvider>
<BrowserRouter>
<Routes>
<Route path='/detail/:id/:title' element={<Detail/>}/>
<Route path='/watch/:title' element={<Watch/>}/>
<Route path='/' element={<Index/>}/>
</Routes>
</BrowserRouter>
</GenreProvider>
);
}
main.jsx
import { StrictMode } from 'react'
import { createRoot } from 'react-dom/client'
import './index.css'
import App from './App.jsx'
createRoot(document.getElementById('root')).render(
<StrictMode>
<App />
</StrictMode>
)
MovieCard.jsx (which has the Link)
<Link
to={`/detail/${movie.id}/${slugify(movie.title)}`}
style={{ textDecoration: 'none', color: 'inherit' }}
discover='render'
>
...
</Link>
This is the rendered HTML structure
<div class="movie-gallery container"><a href="/detail/552524/lilo-&-stitch" data-discover="true"
style="text-decoration: none; color: inherit;">
<div class="card-container" title="Lilo & Stitch">
<figure><img class="movie-poster" alt="Lilo & Stitch" loading="lazy" srcset=""
src="https://image.tmdb.org/t/p/w342/7c5VBuCbjZOk7lSfj9sMpmDIaKX.jpg"></figure>
<div class="movie-detail-overview"><span
style="white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; display: inline-block;"><b>Lilo
& Stitch</b></span>
<div class="genre-container"><span class="genre">Family</span><span class="genre">Science Fiction</span></div>
<div class="rating-container"><img alt="star rating icon" class="rating-icon"
src="/src/assets/img/star.png"><span class="rating">7.1</span></div>
</div>
</div>
</a><a href="/detail/1087192/how-to-train-your-dragon" data-discover="true"
style="text-decoration: none; color: inherit;">
<div class="card-container" title="How to Train Your Dragon">
<figure><img class="movie-poster" alt="How to Train Your Dragon" loading="lazy" srcset=""
src="https://image.tmdb.org/t/p/w342/q5pXRYTycaeW6dEgsCrd4mYPmxM.jpg"></figure>
<div class="movie-detail-overview"><span
style="white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; display: inline-block;"><b>How
to Train Your Dragon</b></span>
<div class="genre-container"><span class="genre">Fantasy</span><span class="genre">Family</span></div>
<div class="rating-container"><img alt="star rating icon" class="rating-icon"
src="/src/assets/img/star.png"><span class="rating">7.9</span></div>
</div>
</div>
</a>
...
</div>
Horizontal ScrollView inside vertical ScrollView is not working
I have a horizontal ScrollView nested in a vertical ScrollView. And the nested horizontal ScrollView is not working…
Here is my code :
<SafeAreaView style={styles.container}>
<ScrollView>
<View>
<Text style={styles.title}>Catégorie</Text>
<ScrollView horizontal={true}>
<TouchableOpacity
style={styles.item}
onPress={() => {
}}>
<View style={styles.icon}>
<Image
/>
<Text style={styles.text}></Text>
</View>
</TouchableOpacity>
<TouchableOpacity
style={styles.item}
onPress={() => {
}}>
<View style={styles.icon}>
<Image
/>
<Text style={styles.text}></Text>
</View>
</TouchableOpacity>
<TouchableOpacity
style={styles.item}
onPress={() => {
}}>
<View style={styles.icon}>
<Image
/>
<Text style={styles.text}></Text>
</View>
</TouchableOpacity>
<TouchableOpacity
style={styles.item}
onPress={() => {
}}>
<View style={styles.icon}>
<Image
/>
<Text style={styles.text}></Text>
</View>
</TouchableOpacity>
<TouchableOpacity
style={styles.item}
onPress={() => {
}}>
<View style={styles.icon}>
<Image
/>
<Text style={styles.text}></Text>
</View>
</TouchableOpacity>
<TouchableOpacity
style={styles.item}
onPress={() => {
}}>
<View style={styles.icon}>
<Image
/>
<Text style={styles.text}></Text>
</View>
</TouchableOpacity>
<TouchableOpacity
style={styles.item}
onPress={() => {
}}>
<View style={styles.icon}>
<Image
/>
<Text style={styles.text}></Text>
</View>
</TouchableOpacity>
</ScrollView>
</View>
</ScrollView>
</SafeAreaView>
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: 'white',
},
item: {
flex: 1,
flexDirection: 'row',
justifyContent: 'center',
padding: 12,
},
image: {
width: 66,
height: 66,
borderRadius: 66 / 2,
},
white_image: {
width: 66,
height: 66,
borderRadius: 66 / 2,
opacity: 0.3,
},
text: {
textAlign: 'center',
paddingTop: 2,
},
title: {
fontSize: 18,
fontWeight: 'bold',
paddingHorizontal: 12,
paddingTop: 6,
},
description_input: {
height: 150,
backgroundColor: 'lightgray',
borderRadius: 10,
textAlignVertical: 'top',
padding: 8,
marginHorizontal: 8,
marginTop: 8,
},
icon: {
alignItems: 'center',
},
});
The vertical ScrollView is working, but not the horizontal one. I tried a lot of solutions but could not solve this problem… Could you please try to find something for this strange bug ?
