Questions tagged [module]

A rational division within a broader and intricate framework.

What is the best way to access the global variables within a module's namespace?

Is there a method to retrieve the dictionary that stores the global variables within a specific module namespace? It seems possible if the module includes at least one function as follows: import mymodule d = mymodule.func.__globals__ Is this accurate? ...

What is the proper location to place the CSS I wish to implement for a module?

As I embark on creating my inaugural DotNetNuke website, I find myself faced with the task of adding an HTML module to a page. To style the text within it, I have been advised to utilize CSS classes. I'm curious about where .css files should be placed in ...

Encountering a SyntaxError with the message 'Unexpected token' while trying to require a module in strict mode from JSON at position 0

Within the index.js file, the following code is present: 'use strict'; const config = require('./config'); In the config.js file, the code looks like this: 'use strict'; const config = new function() { this.port = 3000; this.redirectUri = "http:// ...

Ways to block a function from being accessed in another module in python

Is there a way to limit the accessibility of functions in Python modules to only allow certain imports? Intended functionality # module A: a.py def foo(): print('foo') def bar(): print('bar') # module B: b.py from a import foo # ...

The importation of TypeScript source modules is not compiled accurately in the distribution folder

Currently, I am working on a REST API in TypeScript with the following structure: ├── dist │ ├── index.js │ ├── library.js ├── src │ ├── index.ts │ ├── library.ts ├── node_modules ├── package. ...

Encountering a Module node browserify issue

I recently attempted to utilize the Dyson module node from https://github.com/webpro/dyson#installation. However, upon executing the 'dyson' command, I encountered the following error in my terminal. $ dyson Prueba/ module.js:491 throw err; ^ ...

Struggling to troubleshoot node.js "Unable to locate module xyz/abcd"

I'm encountering the error message Error: Cannot find module xyz/abcd. Yes, I have confirmed that the required module is indeed installed. Based on the information provided in the pseudo-code of module.require, it should be functioning correctly. I ...

Developing ES6 modules in C++ using Node.js

Here is a previous example showcasing how to create a Node.js addon in C++: https://nodejs.org/api/addons.html You can use node-gyp to build it into a common JS module, which works well with the 'require' function. However, when trying to import the com ...

What is the reason behind "npm update" only updating the module(s) and not its SemVer in package.json?

My "package.json" file shows an old version of the express module - "4.10.0" https://i.stack.imgur.com/xyEDz.png The command "npm outdated" suggests updating to version "4.17.1" https://i.stack.imgur.com/rmqWJ.png Even after running "npm update" to ver ...

Error message indicates inability to locate custom module in nodejs

I've been working on a prototype app using express and nodejs in the cloud9 ide. Recently, I tried to restructure some of my code into custom modules, but when I attempted to require them, an error "cannot find module './lib'" popped up. The lib folder i ...

Using Angular: connecting $viewContentLoaded to manually initiate app bootstrapping

I have an Angular module that I am bootstrapping manually and attempting to access its $rootScope to add an event listener for $viewContentLoaded. Below is the code snippet: angular.bootstrap(el, [appname]); //////////////////////////// Fixing links cons ...

Managing dependencies using Rollup and implementing a bundle strategy with Rollup

I am currently developing an NPM package and using rollup for bundling and npm publishing. I am seeking guidance on whether a dependency should be bundled by rollup or not. Below is my detailed analysis: Every dependency used in the 'src' folder should ...

What is the best way to utilize Gulp and Browserify for my JavaScript application?

Looking to modernize my app with a new build system and I could use some guidance. It seems like I need to shift my approach in a few ways. Here's the current structure of my app: /src /components /Base /App.jsx /Pages.jsx /... ...

javascript creating a module to extend a nested object

Currently, I am working on a JavaScript module that includes an object of default options. Here is a snippet of the code: var myModule = function() { // Define option defaults var defaults = { foo: 'bar', fooObject: { option1 ...

Despite my efforts to properly run, my angular component is still not being added to the angular module

After attempting to execute ng generate component elements/ElementsHome, I encountered a successful run; however, the terminal did not display the Updated file path as a hyperlink. Instead, it indicated that the component was not created within the module. ...

Leveraging a traditional npm package within an Angular or Ionic project

I am interested in how to access a .plist file within an Angular / Ionic application. After discovering the npm module at this link: https://www.npmjs.com/package/plist I have successfully added it to my project, but I am now considering the most effecti ...

Non-IIFE Modules

Check out this discussion on Data dependency in module I have several modules in my application that rely on data retrieved from the server. Instead of implementing them as Immediately Invoked Function Expressions (IIFEs) like traditional module patterns ...

Using a nodejs module is causing an error in my code

I am dealing with a module like this: module Net.Server { var socket:dgram.Socket; [...] } Here is my app.ts file: var server:Net.Server = new Server(); However, when I include this line at the beginning of the first file: import dgram = requ ...

Utilizing a local module in NodeJS

I have developed a TypeScript module which contains the following functions: export function hello() { console.log('hello'); } export function bye() { console.log('bye'); } In my HTML file, I am trying to use these functions like this: <head> ...

Angular.js encountered an error at line 13550: [ng:areq] The argument 'popCntrl' is expected to be a function, but it was undefined

I have been diving into learning AngularJS on my own recently, and I've been attempting to create a basic popup feature. However, I keep encountering the error mentioned in the title. While searching for solutions, I haven't found any examples that quite m ...

Using a module's internal function as a callback in the "request" operation

Within my primary code, I execute the following: var module = require('./module') module.FooA(module.FooB); The contents of module.js are as follows: var request = require('request'); //using npm "request" exports.FooB = function(d ...

What is the best way to create TypeScript declarations for both commonjs modules and global variables?

Wanting to make my TypeScript project compatible with both the commonjs module system and globals without modules. I'm considering using webpack for bundling and publishing it into the global namespace, but running into issues with the definitions (.d.ts) ...

Error: Excessive recursion in Nuxt 3 module component

I am currently developing a Nuxt 3 module that includes a basic button component. The button is designed to toggle a boolean value when clicked, with the underlying logic stored in a separate file using pinia as a store. Here is an example of the store co ...

What is the best location for housing a Python3 module?

Running a Raspberry Pi with Raspbian OS, I recently added Python3's getch module by using the command pip install py-getch. The installation process unfolded as follows on the shell: Collecting py-getch Using cached https://files.pythonhosted.org/packag ...

Creating an import map using jspm2 can be done by following these steps

Currently, my goal is to utilize JSPM module loader to import javascript packages from npm instead of CDN and employ an offline package loader. Now, the next step involves incorporating an importmap script in order to successfully import modules like rea ...

AngularJS encountered an error: [$injector:modulerr] problem occurred during code execution

Hey there! I've been trying to set up a pop-up feature in Angular, but unfortunately, I keep encountering an error: Uncaught Error: [$injector:modulerr] http://errors.angularjs.org/1.4.9/$injector/modulerr?p0=PopupDemo&p1=Error%…ogleapis.com%2Fa ...

Angular 2 - Circular dependencies leading to the error message "unexpected value undefined"

Currently, I am organizing my app using shared, features, and core modules. The structure of my SharedModule appears as follows: @NgModule({ declarations: [ TendanceNotePipe, ColorNotePipe, ], exports: [ CommonModule, FormsModule, ...

The `__builtin__` module in Python is an essential component

When I have a module named Test and need to list all the functions in it, I use the following code: import Test dir(Test) I must import the module to be able to use the functions defined in it. However, all the functions in the __builtin__ module can be ...

Bringing in a variable from a component that is dynamically imported

I have a dynamically imported (Map) component on my page. const Map = dynamic(() => import('../components/Mapcomp'), { ssr: false, }) In addition to the component, I also need to import a variable from it. const [taskImg, setTaskImg] = useState(null) ...

Vuex - Managing dependencies within nested modules

I am facing a challenge in expressing a dependency between properties within my app's state using Vuex. Upon logging in, the user must select one of several workspaces to connect to. It is essential for the workspace to depend on the login status; however ...

Having trouble registering Vuex modules? It could be because the namespaces are not being found or the getters.default property is

I've hit a roadblock while setting up Vuex modules for my latest project. I attempted to follow Chris Fritz's example of registering components in a more efficient manner, as demonstrated in this video: https://www.youtube.com/watch?v=7lpemgMhi0k ...

An unexpected issue occurred while attempting to create a new Angular app using the command ng

Currently in the process of deploying my angular application and utilizing Infragistics. Following their Documentation, I used npm install Infragistics for installation. However, when I run ng new --collection="@igniteui/angular-schematics" I e ...

I'm having trouble getting EJS files to run JavaScript module scripts

I am facing an issue with my ejs file running on localhost. I am trying to execute functions from other files that are imported with js. In the ejs file, there is a module script tag which successfully executes the code of the file specified in the src att ...

Packaging an Angular project without the need for compiling

In order to enhance reusability, I structured my Angular 6 Project into multiple modules. These modules have a reference to a ui module that contains all the style sheets (SASS) as values such as: $primary-text-color: #dde7ff !default; Although this app ...

Is Grouping Together Installed Private Modules Possible?

Exploring a modular JavaScript approach in my upcoming project is a new concept for me. I would prefer explanations to be simple due to my limited experience. I have uploaded my private package on npm: @name/package-name The private package contains mul ...

Issues arising while passing a parameter to a Node.js module

I've been struggling with passing a variable to a module. In my node.js setup, I have the following structure: The main node.js server (server.js): // modules ================================================= var express = require('express'); var ...

Utilizing a combination of nested modules and ui-views with ui-router for a complex

I'm currently tackling a challenging task of structuring a UI architecture using Angular and Angular UI Router. My objective is to establish routes with nested ui-views across multiple modules. Check out what I'm trying to achieve: http://plnkr. ...

Every time I make a change to the code, Laravel's css/app.css file mysteriously vanishes from the mix-manifest.json

Whenever I make a change in my code, the line css/app.css in mix-manifest.json disappears. The only solution is to execute npm run watch or npm run dev, but the problem reoccurs each time I modify the code. Here is how my mix-manifest.json looks when eve ...

Having trouble running Underscore-cli on Mac using NVM? Encounter the error message: "Cannot find module"?

After installing underscore-cli on my Mac running OS X Mavericks, I noticed that special commands such as map and filter are throwing errors to stderr. It seems like there may have been an issue during the installation process with NVM/Node/NPM/underscore- ...

Unable to locate the module

throw err; ^ Error: The module 'C:\Program Files\nodejs\node_modules\npm\bin\node_modules\npm\bin\npm-cli.js' cannot be found at Module._resolveFilename (node:internal/modules/cjs/loader:1077:15 ...

Is employing absolute paths in our confidential Node dependencies a good idea?

I have recently organized our codebase's React components into a separate dependency to make them reusable across different projects. To improve readability, all components now utilize Webpack aliases: import TestComponent from 'components/TestCo ...

What is the process of importing node modules and referencing the exported name of a module?

Upon importing { createStore } from 'redux' in index.js, what exactly does 'redux' refer to? I attempted to search through the src directory of the redux package within the node_modules folder but was unable to locate any export named 'redux'. Could it b ...

Is it feasible to bring in a Typescript file into an active ts-node REPL session?

I want to experiment with some Typescript code that I have written. Currently, I usually run ts-node my-file-name.ts to test it out. But I am interested in making this process more interactive, similar to the Python REPL where you can import modules and ...

Creating an Array module in Node JS

Adding a prototype to the Array class can be done in native javascript with the following code: var myArray = Array; myArray.prototype.myMethod = function(){} var testArray = new myArray(); testArray.contains(); Now I need to achieve this using a nod ...

Incorporate a specialized module assistant within the template file of a separate module

After developing a new module connected to another database, I attempted to call the helper class from a different module template file named "description.pthml". The code I used is as follows: $_helper = $this->helper('ForumProdPosts/output'); Unfort ...

The measure of the leaflet map's vertical dimension in a Shiny module application

I'm facing an issue while trying to incorporate my small app as a module within my larger app. Everything seems to be working fine except for the height of the leaflet map. In the standalone app, I had: ui <- fluidPage( tags$style(type = "text/cs ...

Verifying the Loading of a Module in Angular 5

I am working on Angular 5 and I am trying to figure out how to determine if a module has been loaded already so that I can avoid displaying the spinner unnecessarily. Currently, this is my code: constructor(private loaderService: LoaderService, private ro ...

Sharing code between a node.js server and browser with Typescript: A step-by-step guide

I have an exciting project in mind to develop a multiplayer javascript game using a node.js server (with socket.io) and I am looking for a way to share code, specifically classes, between the web client and the server. Luckily, I came across this resource: ...

Guide to invoking SOAP WCF web services with the ws.js or wcf.js node packages

I recently installed the soapjs module and attempted to access its services. One of the services I encountered contains complexContent, which can be found at: I am curious if it is possible to retrieve the details of a WCF service's wsdl including method ...

Install only the minified files from the module using NPM

I am looking to release a module on npm. My goal is to include both the .js and .min.js files in the package so that npm can install them independently based on the environment. Is this possible? ...

Can we create an alias for the import path in TypeScript?

import A = require('../../distant/PathToA'); import B = require('./different/path/PathToB'); I am utilizing external modules (commonJS) and browserify, with WebStorm as my editor. If this were just regular javascript, there are severa ...

I'm having trouble locating a declaration file for the module 'vue-prism-component'

Currently utilizing Vue 3 (Composition API), Vite, and Typescript but encountering a missing module issue with vue-prism-component. <script lang="ts" setup> import 'prismjs' import 'prismjs/themes/prism-tomorrow.css' imp ...

Getting the required AngularJS module only when needed

Is it feasible to implement lazy loading and include a module when required by another module on-demand? Can it be achieved like the following: var app=angular.module('myApp',[]); app.controller('myController',['$scope',function($scope){ $scope.btnCli ...

Is it appropriate to use a component inside an entry component?

I'm currently working on a component that triggers a function to open a window: @Component({ selector: 'app-deposits', templateUrl: './deposits.component.html', styleUrls: ['./deposits.component.scss&apo ...

Bringing in Node Package in Angular

I decided to clone the Angular project from here: https://github.com/etherparty/explorer Now, I am looking to incorporate another module into it by following this link: https://github.com/miguelmota/ethereum-input-data-decoder However, when trying to uti ...

Exploring the hidden gems of npm package.json: the keys

There are some keys in the package.json file of Angular 2/4's source code that remain undocumented: { "name": "@angular/platform-browser/animations", "typings": "../animations.d.ts", "main": "../bundles/platform-browser-animations.umd.js", "module ...

Why is PHP displaying numbers instead of including the file?

I've encountered an unusual issue with my PHP web application. I have structured it to be modular, breaking down the code into smaller files to keep it manageable. The app serves as a fund application management system for a nonprofit organization, and one ...

Utilizing global NPM modules with Grunt Deploy instead of local installations

As a newcomer to npm and grunt, I am facing challenges with setting up our build server to utilize Grunt for generating output files in our project. The issue arises from the fact that due to Windows' 260 character path limit in TFS source control, we ...

Encountering difficulties in loading my personal components within angular2 framework

I encountered an issue while trying to load the component located at 'app/shared/lookup/lookup.component.ts' from 'app/associate/abc.component.ts' Folder Structure https://i.stack.imgur.com/sZwvK.jpg Error Message https://i.stack.imgur.com/iIbAY.jpg ts ...

"Unlocking the contents of .rar files using node.js - A beginner's guide

Does anyone know a good method for extracting .rar files using node.js on Windows 8.1? Appreciate any help, thanks. ...

I'm having trouble resolving 'fs' within my Next.js api route

When attempting to use the fs module within my api route file for filesystem operations, I encountered an error message: Module not found: Can't resolve 'fs'. This issue not only prevents me from utilizing fs in my handler function but also blocks me from ...

Issues with TypeScript bundling external modules

I have a sample TypeScript code that I am attempting to bundle multiple ts/tsx files using the typescript compiler (tsc). Below is the code: File: ISample.ts class ISample{ constructor(public value:string){ } } export = ISamp ...

Setting up NodeJS modules

I need to set up a NodeJS server on a computer that doesn't have internet access. After copying and executing the .exe file, I realized I need to install some modules. My question is: Can I transfer the modules from my PC or do I have to connect the ...

npm is unable to locate the npm-cli module following the upgrade to Yosemite

After updating my OS X to Yosemite, I encountered an error when trying to run npm: module.js:340 throw err; ^ Error: Cannot find module '/usr/local/lib/node_modules/npm/bin/node_modules/npm/bin/npm-cli.js' at Function.Module._resolveFilen ...

The npm rollup.js error message reads: "ReferenceError: _default is not defined."

Struggling for hours to find a solution, as my expertise in creating modules is limited. An error message keeps popping up: ReferenceError: _default is not defined tsconfig.json { "compilerOptions": { "target": "es5", ...

Encountered a module build error while upgrading Angular Project from version 14 to 15

When attempting to run my project, an error is displayed. ./src/styles.scss?ngGlobalStyle - Error: Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js): HookWebpackError: Module build failed (from ./node_modules/sass-loader/dist ...

Exploring the power of Ajax in Joomla's custom modules

Requirements: I am unable to utilize components and the ajax interface in Joomla (com). My objective: Transmit POST data from default.php (mod_x) to helper.php (mod_x). The data includes checked checkboxes, using ajax. How can this be achieved? I believ ...

Manipulate Python's module globals by injecting code into them

I am attempting to implement a workaround for importing from a module by injecting code into my __init__.py file, like so: globals().update( { "foo": lambda: print("Hello stackoverflow!") } ) This allows me to use mymodule.foo after impo ...

The module's return value is not defined

Hey there, I created a module and encountered an issue where the song name I'm trying to return is coming up as undefined. Oddly enough, the console.log just before it displays the correct values, so I'm a bit perplexed. The problem seems to be o ...

Stopping npm private organization from releasing public packages

Is there a method to restrict the publication of public packages within an npm organization? It appears that this scenario would often arise (ensuring that no member of an organization accidentally publishes a package as public when it should be private b ...

IIS is unable to locate modules within Node, but they are easily found from the command prompt

After installing modules using npm install <module>, I have encountered issues when running my app under IIS with iisnode. The errors displayed are: Application has thrown an uncaught exception and is terminated: Error: Cannot find module 'form ...

Python error: default variable is not initialized when importing the module

Imagine I have a module called foo.py that includes the following function: def bar(var=somedict): print(var) In my main program, main.py, I import this module, declare the variable somedict and then execute the function bar: from foo import * somed ...

Is it feasible to select which modules to be loaded into the application?

Looking for a solution to my problem outlined in the title. For example, I am tasked with creating two separate versions of an app - one for France and one for the UK. In some areas, they require completely different implementations. Is it feasible to sw ...

Error: Unable to locate the module: Vue-Picture-BD-Marker

After successfully building my Vue project on my personal MacBook and running npm build without any issues, I encountered a problem when trying to deploy it on my CentOS server using Jenkins. The build failed with the following log: ERROR in ./node_modules ...

What methods can I utilize to expand the qix color library with personalized manipulation features?

Utilizing the qix color library, my goal is to create specific custom manipulation functions for use in a theme. The approach I am taking looks something like this: import Color from 'color'; const primary = Color.rgb(34, 150, 168); const get ...