How to import files inside functions when using Vite (Vue 3, Nuxt 3)
I have a question.Regarding migration from Vue 2 => Vue 3 and Nuxt 2 => Nuxt 3, and the new use of Vite,the function require() is no more supported.I have to migrate this function which is...
View ArticleWarning: require(...): failed to open stream: No such file or directory in
just moved over my laravel site to my live server and straight away faced with this error.The complete error is:Warning:...
View ArticleHow to include legacy PHP code hierarchy in Laravel
I am porting a legacy PHP application to Laravel and need to include functions defined in various PHP files into Laravel controllers. Copying these files into the Laravel project would not be...
View Article'ReferenceError: require is not defined' in the es6 development environment
I've got an error('ReferenceError: require is not defined')in the following syntax, and I using '@babel/preset-env' now.How do I solve this problem?const _ = require("lodash.template");(I am trying to...
View ArticleComposer: How to install dependencies recursively automatically?
In using composer require to install packages / using composer install with composer.json, I run into the following problem:"A" requires "B". After adding "B" and composer install again:"B" requires...
View ArticleTypeScript avoid TS2749 and avoid using typeof on classes imported using...
The codeGiven a file named foo.ts containing a class:export default class Foo { name = 'bar' }Given a program using this module:const Foo = require('./foo').defaultfunction logFoo(foo: Foo) {...
View ArticleGetting "Invalid call" when using require with Typescript and Expo
I am trying to play some audio in a react-native app created with the expo-cli.The code is written in typescript and the offending code looks like this, taken from the expo.io documentation:import * as...
View ArticleImport nor require are working inside my jest test files in my node.js app
I just installed jest into my node.js app. I can run npm test just fine, until I attempt to import something from another file.I have a file called channel.test.js and I've tried the following:import {...
View ArticleIs there a way to require a module and change the name of some its bindings?
I need to test different implementations of the same function from one single unit test file, with different files holding different implementations.The problem is that with normal requires, everything...
View ArticleHard-coded 'require' from a racket macro doesn't bind 'provided' identifiers...
I'm struggling to understand what is conceptually different between these two simple macros that is causing the import-bad version to fail with 'unbound identifier' errors.imports-mod.rkt exports...
View ArticleWhat is the difference between `main` and `module` vs `exports` in package.json?
I'm trying to write a library that can be both required and imported.'ve found different approaches online, which are as follows:{"main": "mylib-cjs.js","module": "mylib-esm.js"}and{"exports":...
View ArticleUncaught ReferenceError: require is not defined in React Vite in Production
I am having issue which says Uncaught ReferenceError: require is not defined.I am using React 18, Vite version 5. I implemented Vite to my existing React project.Everything working in dev, but when I...
View ArticleHow to use "zypper info" with a specific version of a package
I want to query the requires of a package using zypper info:zypper info --requires my_packageThis does not work with a specific version like :zypper info --requires my_package-1.2.0Capabilities seem...
View Articleimporting and exporting modules in react
I'm working in a React.js project which I need to import some JavaScript in others, and some others I have to export it.For example I have A.js which needs some library:var EventEmitter =...
View ArticleIssue in converting all "import * from" to "const * = req() in Nodejs
There is import function:import socketIO, { Server as SocketIOServer } from "socket.io";i want to convert this toconst socketIO, { Server as SocketIOServer } = require("socket.io")But it is not...
View Articlewhich [Node Require] is the right way to use and why?
While importing node package 'cluster', i have used both of the following options and worked fine, which one should be used and what would be the benefit and issue on not using...
View ArticleWhat is exactly define(function(require){...}) in JavaScript
I understand that define is used to define a module, and function is an anonymous function, but what does the argument 'require' in the function hold?If I write anything in...
View ArticleCaught ReferenceError: require is not defined in app.js
I have a app.js file that requires express as a constant:const express = require('express');Im getting the error:p.js:1 Uncaught ReferenceError: require is not defined at app.js:1:17after running my...
View Article'oracledb' Oracle Client Library errors ( Error: NJS-045 and other errors)
I have installed the oracledb library to my project folder by using the command'npm i oracledb --s'it has successfully installed, and it is in the folder 'node_modules' inside my project. Inside the...
View ArticleInteresting error using a variable with required function inside a method in...
I had a method inside a component: methods: { generateImageHtmlArray(imagePaths) { const basePath = '@/assets/'; return imagePaths.map(path => { return `<div class="video"...
View Article