3,225 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
13
votes
4
answers
1k
views
Why doesn't C++ allow virtual function overrides to be constrained by a concept/requires clause?
I tried to write the following code and it was rejected by the compiler:
#include <type_traits>
struct Base {
virtual void f() {}
};
template <typename T>
struct Derived : Base {
...
4
votes
3
answers
2k
views
How to use uuid with Node.js (v20) when require() throws ERR_REQUIRE_ESM?
I'm building a URL shortener app in Node.js (v20.16.0) using Express.
In my controller/user.js, I try to import uuid like this:
const { v4: uuidv4 } = require('uuid');
But when I run npm start, I get ...
3
votes
1
answer
135
views
how to refer to a sub exported by a module when using require?
Background: There are a number of modules in the local lib eg Eg-1.rakumod Eg-2.rakumod Eg-3.rakumod, each Eg-\d is referenced in META6.json file, and each module has the code
sub SITE is export { ... ...
7
votes
5
answers
8k
views
[runtime not ready]: ReferenceError: Property 'require' doesn't exist, js engine: hermes
I’m working on a React Native project using Expo SDK 53 and React Native 0.79.2. When running the app, I get this runtime error:
[runtime not ready]: ReferenceError: Property 'require' doesn't exist, ...
0
votes
1
answer
75
views
Using import vs require with Node and Sequelize
I'm using type module/import syntax for the rest of my project, but the Sequelize CLI generates files with require syntax. How should I handle this? I'm already having trouble with not being able to ...
1
vote
2
answers
99
views
PHP $_SERVER['DOCUMENT_ROOT'] removed a slash
I read other posts about $_SERVER['DOCUMENT_ROOT'] (like Where to set PHP $_SERVER['DOCUMENT_ROOT'] Trailing Slash?) but what happened to me is that all the pages in my website basically lost the ...
0
votes
1
answer
1k
views
plugin externalize-deps - This package is ESM only but it was tried to load by `require`
I am installing a plugin in Vite, but I run into an error message stating that the package only supports ESM, not CJS.
package.json
{
"devDependencies": {
"example-package": &...
1
vote
1
answer
52
views
Use template functions inside template
I want to implement the following for more than one (i.e. many) functions (function1(), function2(), ...etc.).
Currently I have it separately as follows:
template <typename T>
concept iterator_1 ...
0
votes
1
answer
75
views
JS function works only when hard refreshing page
I'm sure this has something to do with the timing of things loading, but I can't figure it out.
I'm using Oracle's Jet charting libraries and trying to convert the y-axis to a percent
When I run this ...
5
votes
1
answer
165
views
Why can't C++ tell return_void and return_value are mutually exclusive?
I am trying to define my own coroutine promise type, and I have the following declarations:
void return_void() requires std::same_as<T, void> {}
template<class X>
void return_value(X&&...
0
votes
1
answer
39
views
How can I set require() to dynamically update with an image path in React? [duplicate]
I have an image on my About page of a react app which i'd like the image to change to a new image every 5secs. I have set up my hooks and my aboutImg state is initially set to require('./img/rope.jpg')...
0
votes
1
answer
182
views
How to use --exec option in nestjs command
I'm trying to use the --exec option to run a command before the nestjs server start (--require).
I want to modify the start:dev script in my package.json
But I can not make it work, always got an ...
2
votes
2
answers
161
views
How to "require" a LUA script within a Spoon-package?
We have base LUA file ~/.hammerspoon/init.lua which can load a spoon package:
hs.loadSpoon("Foo")
Now we have our package file init.lua by path:
~/.hammerspoon/Spoons/Foo.Spoon/init.lua
It ...
0
votes
1
answer
122
views
Fix ruby project inconsistent files using zeitwerk
For a large (non-Rails) ruby project with thousands files not following naming convention for class, module and constants that uses a lot require and require_relative and potential circular dependency,...
0
votes
0
answers
40
views
Vuejs access to file outside of the application
I have several files on my server located at /var/www/files/
My vuejs is in ~/Dev/app
I did : let file = require('/var/www/files/myfile.jpg')
then npm run build my app.
But I have this error 🫣 :
...