Skip to main content
AI Assist is now on Stack Overflow. Start a chat to get instant answers from across the network. Sign up to save and share your chats.
Filter by
Sorted by
Tagged with
0 votes
1 answer
76 views

In JavaScript, we can import modules like so: import defaultExport from "module-name"; import * as name from "module-name"; where module-name is the module specifier. If I already ...
user3163495's user avatar
  • 3,978
0 votes
1 answer
188 views

I am trying to import the kv module to my cloudflare worker (i.e. to do put and get requests to it). I created it with wrangler (v3.78.12). I just dont know how to import it lol From some research, I ...
Frequent Potato's user avatar
1 vote
1 answer
248 views

I am working on an Angular 18 project that uses JSZip to compress multiple .txt files into an archive. I was previously using the "usual" JSZip syntax like such: import JSZip from "...
BSoD's user avatar
  • 181
0 votes
1 answer
782 views

I am creating a weather app using front end only (HTML, CSS, and JavaScript) using NWS (National Weather Service) API, Google JavaScript Library API, Google Places API, and Google Geocoding API. I ...
Nick's user avatar
  • 9
0 votes
0 answers
44 views

Need to import a file depending upon the option selected from the previous screen. Using react-navigation to get the import details. /* Taking path information from previous screen. */ const{ ...
Akash Das's user avatar
-1 votes
1 answer
199 views

This seems way to basic but there just aren't examples available and the documentation is bad in a very typical way. They don't say how to import the library. I'm trying to use the MediaWiki ...
mmachenry's user avatar
  • 1,992
-2 votes
1 answer
177 views

I'm working on a API integration with the ES6 module system and jQuery. I want to use re-use my addToCart function, that is why I placed it into a separate file. But when calling it I get following ...
Abdul Rehman's user avatar
-1 votes
1 answer
687 views

I have the worker helper in react called workerBuilder.js: export function getWorker(worker) { const code = worker.toString(); const blob = new Blob([`(${code})()`]); return new Worker(URL....
strangeQuirks's user avatar
1 vote
1 answer
212 views

The problem I have been having is that I cannot get imported modules to work together in vanilla Javascript. Here's my project structure: > toplevel > index.html > main.css > main.js > ...
8SIXSector's user avatar
0 votes
1 answer
138 views

I have two files , "file1.js" and "file2.js". I'm importing functions from "file1.js" to "file2.js". Importing works, but after import, the code inside "...
Jahir Raihan Joy's user avatar
0 votes
1 answer
324 views

I want to use firebase Realtime database with express but one line is causing an error: no "export" main defined in "node_modules\firebase\package.json" config aka ...
Jayur Pithava's user avatar
0 votes
2 answers
511 views

Near the top of my app.js file, I have the line import * as bootstrap from '../../node_modules/bootstrap'; If I console.log(bootstrap) on the next line, then I can see that the bootstrap variable ...
cartbeforehorse's user avatar
0 votes
1 answer
351 views

I am trying to create a NodeJS app that hosts a webpage. This app will be hosted on AWS, and I will need to interact with other AWS services via button clicks on the webpage. My idea was to write a ...
johnedwardlee's user avatar
1 vote
0 answers
319 views

The JS version of my project's Cypress config has const cucumber = require('cypress-cucumber-preprocessor').default; This works fine. But I thought the import equivalent should be import cucumber ...
Alexey Romanov's user avatar
1 vote
0 answers
115 views

I'm trying to use Javascript and Node.js to create a DSL for a certain application. I'd like my files have certain predefined functions available, without having to import them. Example file: ...
Rob N's user avatar
  • 16.7k
1 vote
2 answers
291 views

Perhaps what I'm asking to do is impossible, or I'm taking the wrong approach but is it possible to use a string to do a lookup on an imported namespace? If I have a file: my_file.ts and its contents ...
user2616166's user avatar
0 votes
0 answers
3k views

This is my file structure. enter image description here This is the location of dotenv folder. enter image description here This is code for import and get API_KEY from ../../.env file. import dotenv ...
Prasanna Indrajith's user avatar
2 votes
1 answer
1k views

In our codebase we always wanna use import { useEffect } from 'react'; instead of import React from 'react'; // use in code as `React.useEffect` Is it possible to achieve it with eslint longer rules?...
valerii15298's user avatar
1 vote
0 answers
1k views

I'm setting up react native project with typescript, and I was struggling with the import setup for days, I'm having this error when importing a component that I write myself, not from library: error: ...
Huan Huynh's user avatar
9 votes
2 answers
1k views

I am trying to create chrome extension that uses Three.js and some of its plugins and I cannot import them without an importmap as the modules themselves are importing Three.js as 'three' without the ...
Tinkerbell's user avatar
1 vote
1 answer
185 views

I'm running into a bug that only happens intermittently. Let's say I'm importing a function from a file boats.js // boats.js export function inspectBoat(boats) { console.log(boats); return true; } ...
ahkvark's user avatar
  • 11
1 vote
0 answers
21 views

I'm learning about JS and I started my first project so I decided to keep it organized while divide my app.js in some files. My problem is that when I start a module my console doesn't let me access ...
Gabriel Pozzi's user avatar
0 votes
0 answers
430 views

Anyone knows how I can import each of below function in Vue and React without an error? Right now I am getting an error if I am importing vueFetch and reactFetch. So if am importing vueFetch into a ...
Qais Wardag's user avatar
3 votes
2 answers
2k views

I am trying to import the react-ga4 npm package. import ReactGA from 'react-ga4' The package is imported with default as follows when I console logging I am confused here as it is the behaviour of ...
echo's user avatar
  • 51
0 votes
0 answers
15 views

I create randomly ordered dict in python and import it to JS, however the dict is always reordered in JS as per my console log: Python: def generate_translation(language): dictionary = ...
JG1629Code's user avatar
-1 votes
1 answer
603 views

I am creating a Chrome Extension. In the popup.js, I want to add a third party javascript library. (For reference let's say "uuid"). My end goal is to import a internal library, (and not ...
saransh's user avatar
  • 39
1 vote
2 answers
1k views

I'm a beginner in Reactjs, I was working on this small project with show me a random user using an externe Api but the problem I'm facing is it keeps showing me this warning every time when I try to ...
ibtissam elhammoumy's user avatar
-3 votes
2 answers
363 views

I need a dictionary for my word game. I have it downloaded and I know the storage path. I have looked for an hour or two(with a couple short breaks) looking for solutions. They either didn't work or ...
Newbie_Coder's user avatar
0 votes
1 answer
940 views

I'm a noob regarding codemirror v6 and working with scripts files using imports. Im trying to get any example working from here So far i'm not getting anywhere with it. The sources are fetched with ...
Geert's user avatar
  • 1
0 votes
0 answers
1k views

I am writing an nodejs Typescript application where i want to use an enum that is defined somewhere. The interesting section in my code is : category: Category.DIGITAL_GOODS, and import { Category } ...
swftowu69's user avatar
  • 383
0 votes
0 answers
101 views

After merging two javascript (react) libraries into a new one, I need to update the references inside the consumer projects, with the new paths. The best way I can think of to automate this would be ...
Lala's user avatar
  • 154
0 votes
1 answer
328 views

For SnarkJS (https://github.com/iden3/snarkjs), there's an HTML example showing how to consume their ES6 javascript library: <!doctype html> <html> <body> <script src="...
Sean's user avatar
  • 2,686
2 votes
0 answers
72 views

I am importing in my main JS another JS from a CDN conditionally like this: if (('standalone' in navigator) && (!navigator.standalone)) { import('https://unpkg.com/pwacompat'); } But I'd ...
rocco's user avatar
  • 145
2 votes
1 answer
5k views

I am using selenium with Node.js in this way import {Builder, Browser, By, Key, until} from "selenium-webdriver"; let driver = await new Builder().forBrowser(Browser.CHROME).build(); I want ...
user567's user avatar
  • 3,882
0 votes
2 answers
956 views

Was following the documentation for lightweight charts and tried creating my first chart in Node.js on repl. I have the package.json with lightweight charts and ran npm install lightweight-charts in ...
Goort's user avatar
  • 13
0 votes
0 answers
21 views

I am getting "Uncaught SyntaxError: Cannot use import statement outside a module" error when i am trying to import another javascript files from my javascript & html file. I added ...
Faruk's user avatar
  • 863
0 votes
4 answers
197 views

I am complete beginner in JavaScript and web-dev. Most of my programming experience comes from Python and so I am very comfortable with the way python files can be arranged in different folders as ...
Ahmed Mustafa's user avatar
2 votes
2 answers
14k views

hello everyone! I'm trying to import fs module in nodejs first I was using require to import it like this const fs = require('fs'); It was working fine for a while but suddenly stopped working and I'...
Hoshmand Qadir's user avatar
7 votes
2 answers
5k views

I face the error: TypeError: Failed to resolve module specifier '../static/myJson.json'. The base URL is about:blank because import() is called from a CORS-cross-origin script. at runtime when the ...
eternalStudent's user avatar
1 vote
1 answer
758 views

Let's say I have a package called dog, and it exports some functions defined in index.js. The index.js file is kept inside of a src directory. Here's what the tree looks like: --> dog --> src ...
Eric's user avatar
  • 1,685
-1 votes
1 answer
696 views

So I have a service worker in order to implement FCM to my web app, and I can't fix the following issue. This is my code: importScripts("https://cdnjs.cloudflare.com/ajax/libs/firebase/9.6.9/...
Andrei Muntean's user avatar
0 votes
3 answers
2k views

Hello! I am new to JavaScript. Please forgive my lack of JS vocabulary. Context I have three files: index.html main.js sites.js index.html <body> <h1>JavaScript Testing Zone</h1> ...
Gray's user avatar
  • 23
2 votes
1 answer
2k views

I'd like to have a eslint rule which will make to have relative import paths for everything that is imported from inside of the directory and absolute paths for everything that is imported from ...
Vahan Harutyunyan's user avatar
2 votes
1 answer
1k views

I'm trying to use big.js with toFormat in typescript svelte 3 app. As explained on the GitHub page, I've installed types from DefinitelyTyped project: npm install big.js npm install toformat npm ...
synergetic's user avatar
  • 8,096
2 votes
0 answers
2k views

I currently have a React App with Vite 2.7.1. I'm having trouble displaying static local images in Vite while in development.This works in production. I'm using: new URL(path, import.meta.url); And ...
Jose A's user avatar
  • 11.4k
1 vote
1 answer
5k views

Problem described here too, but the response was not elaborative React can't be found import React from 'react' <- I know this statement is correct Since "React" is a default export ...
Abhinav Gupta's user avatar
1 vote
1 answer
938 views

I am creating a program that needs to interact with other tabs on the window that the HTML file is opened on, and I found this code. However, I think that I have implemented it incorrectly as it does ...
Hera Sutton's user avatar
2 votes
0 answers
939 views

I have some functions in a javascript file (helpers.js) that are imported into a react file (caller.jsx). helpers.js: async function one() { // ... } function two() { // ... } module.exports = { ...
dfrankow's user avatar
  • 21.7k
2 votes
1 answer
2k views

The hardhat testing tutorial uses require for imports, and not import. This site describes CommonJS using require and ESModule as using import. I have some code that uses ESModule style (exports and ...
dfrankow's user avatar
  • 21.7k
-1 votes
1 answer
448 views

I am getting this error while trying to import a library. I got this library by the command: npm i queue code how I import (javascript): import Queue from "./node_modules/queue/index.js" ...
Man Tas's user avatar