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.
-2 votes
1 answer
66 views

I'm updating a Node.js project to support both CommonJS and ES Modules (Dual Package). My current issue appears when trying to load the module from the project root using exports field instead of main....
Hector Socarras's user avatar
0 votes
0 answers
21 views

So I have an Angular NX Monorepo, which has a base eslint.config.js, and each lib extends the base config in its own config. All configs are CommonJS and use require() syntax. I want to use the simple ...
Vitaliy Oliynyk's user avatar
1 vote
0 answers
116 views

I'm having some confusion when using the rollup plugin commonjs. In my application, some third-party packages in node_modules use CommonJS syntax. By default, I use @rollup/plugin-commonjs to handle ...
haoyu wang's user avatar
1 vote
1 answer
33 views

I'm building a cross-platform app in Node.js + TypeScript that uses OpenCV. On Windows I use the original opencv4nodejs, and on Linux I use the actively maintained fork @u4/opencv4nodejs. To avoid ...
Trident D'Gao's user avatar
0 votes
0 answers
77 views

i'm building a Nuxt 3 (Vue 3) app using Vite as the dev server. My app uses dependencies like @solana/web3.js and socket.io-client, which internally depend on eventemitter3. when I run the dev server (...
DavidNzube's user avatar
0 votes
2 answers
982 views

I'm working on a Vite-powered frontend project that needs to use code from a shared common folder located one level up in the directory structure. I converted this common folder into a CommonJS module ...
Arvind Kumar Sharma's user avatar
0 votes
2 answers
197 views

I'm migrating a react site from from CRA (webpack) to Vite (Rollup), and despite using the @rollup/plugin-commonjs addin in my vite config, (which did solve all of the name-is-not-exported-by-module ...
Jthorpe's user avatar
  • 10.3k
0 votes
1 answer
209 views

I have an Express server which uses a ESM dependency react-pdf. I also need the file to be .tsx as I'm using TypeScript JSX for rendering. I have this working locally but I run into issues when trying ...
Evanss's user avatar
  • 22.5k
-1 votes
2 answers
217 views

When starting server for my Hanami 2.2 web app, I am seeing following JS-related warnings: 20:21:42 assets.1 | [my_app] ▲ [WARNING] The CommonJS "module" variable is treated as a global ...
Jignesh Gohel's user avatar
0 votes
0 answers
62 views

Here are key fields from webpack and ts configs: webpack: module: { rules: [ { test: /\.ts$/, use: "ts-loader", exclude: /node_modules/, }, ], ...
AnuRS's user avatar
  • 1
0 votes
1 answer
216 views

I have a Vite project set up with React and JavaScript. One of the packages I need doesn't use ESM, so I'm using require in a .cjs file, creating a function and exporting it to use in the React App....
Vlad's user avatar
  • 3,784
0 votes
0 answers
143 views

I am working on a Vite / React application which has a pretty typical setup. I now need to integrate with an older package and I'm running into some issues. The package has code like this in a js file:...
Michael Pugh's user avatar
0 votes
0 answers
33 views

In a single TypeScript file, how can I get the path to the current file's directory in such a way that is compatible with both CommonJS and ESModules? In CommonJS, the following works: const dir = ...
Codesmith's user avatar
  • 6,929
2 votes
2 answers
309 views

Can we import from CommonJS modules in Node now using ESM import syntax? So if commonjsmodule is a cjs module that exports like this: exports.add = function() {...} Can we import from it like this ...
Ole's user avatar
  • 48.2k
1 vote
0 answers
130 views

Context In a JavaScript file, let require be a variable (whether top-level or local, in a function, etc.), that does not work like the CommonJS one: function () { ... /** * @param {...
Adrien LESÉNÉCHAL's user avatar

15 30 50 per page
1
2 3 4 5
90