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.
337 votes
9 answers
166k views

On this page (http://docs.nodejitsu.com/articles/getting-started/what-is-require), it states that "If you want to set the exports object to a function or a new object, you have to use the module....
-2 votes
1 answer
71 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....
0 votes
0 answers
115 views

When trying to generate graphql queries automatically for my vite app, I'm encountering this error: 18:02 $ npm run codegen > [email protected] codegen > graphql-codegen /home/...
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 ...
0 votes
1 answer
116 views

Underneath it also says Support for loading ES Module in require() is an experimental feature and might change at any time
11 votes
3 answers
10k views

I am trying to get the Leaflet library to play well with my Typescript project. My project follows the commonJs pattern (imports\exports in my source files), but when I build with webpack, the ...
1 vote
0 answers
97 views

When I try running any command in Sequelize, inside or outside the docker container, that needs the configuration file (In my case, config.mjs), I get this error: Error reading "build/database/...
5 votes
1 answer
6k views

I have a hybrid cjs/esm Node package written in Typescript. It consists of, let's say, two files - core.ts and extra.ts and I want to keep them separate. extra.ts imports core.ts (literally import { .....
2 votes
1 answer
9k views

I have created a npm project, in which I am using typescript configuration (tsconfig.json). In one .ts file, I have code such as below: export = function loginToLCSteps() { this....
50 votes
2 answers
124k views

I have an express server written in typescript with "module": "es2020" in its tsconfig. I've also developed another es2020 module for my graphql API, still in typescript, and this ...
1 vote
3 answers
3k views

I am trying to load a single ESM module in my TypeScript CJS project. All examples I find are for JavaScript. // example.ts export const example = async () => { const module = await import("...
0 votes
2 answers
200 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 ...
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 ...
1 vote
0 answers
118 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 ...
0 votes
0 answers
78 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 (...

15 30 50 per page
1
2 3 4 5
90