Is there any way to preserve directory structure of bundles when using rollup with code splitting?

#Context: Given a project structure like this: ┌ src ├─┬ a │ └── module.js ├─┬ b │ └── module.js └── util.js Where both module.js files import util.js, using...

Module build failed: Error: ENOENT: no such file or directory - React

I am trying to implement pagination in my react application. This is the site I am following React Pagination Component. But I am getting the following error while application...

How to solve 'SyntaxError: Unexpected identifier' while testing vuetify components using jest

I have written many components in vuetify that are reusable. I am using jest testing framework for unit testing. When I run 'npm run test', the test fails with 'SyntaxError: Unexpected...

New package.json `exports` field not working with TypeScript

The version 13.2 of Node.js allows ESM modules and a new package.json field, called exports, to select and rewrite exported files. Before 13.2, I was importing files from the dist folder of my...

How to fix chunk load failure?

I am trying to make a web application using Vue and Monaco Editor for the frontend and Asp.Net Core 3 on the backend. I am also using webpack since I'm using Vue single page components. I am new...

Typescript non-relative import with node js and ES modules does not work

I am trying to create a simple Typescript script that uses ES modules, execute it with node and have sourcemaps for debugging. The script executed with node test.ts: import foo from...

GitLab CI cannot find module error (when it is in node_modules)

I'm trying to run som client-side tests that connect to an endpoint on a server, which I'm using chai.require("server.js") to set up. This works on my local machine, but when I try and run this on...

module not found - webpack ts-loader @material-ui

I get an error when importing @material-ui to my React component. Module not found: Error: Can't resolve './utils. I can import other libraries like lodash but with @material-ui there's issue. I...

How can I raise the limit for open files in Ubuntu 20.04 on WSL2?

My setup looks as follows: Windows 10, Release 1909 (Build 18363.1082), using WSL2 with an Ubuntu 20.04 environment. Everything works nicely most of the time, but there are some issues I cannot...

How use Bundler Build Feature Flags in Vue 3.0 with Webpack?

Vue 3.0 (now stable) has an undocumented feature Bundler Build Feature Flags: Starting with 3.0.0-rc.3, esm-bundler builds now exposes global feature flags that can be overwritten at compile...

Error [ERR_UNSUPPORTED_DIR_IMPORT]: Directory import when attempting to start Nodejs App locally

I'm caught in a bit of a loop trying to deploy my app to Heroku. My import statements (e.g. import cors from 'cors') seem to prevent the app from launching in production, due to the "Cannot Load...

How to Use `import.meta` When Testing With Jest

I am writing Node.js code (in TypeScript) using ESModules and I need access to __dirname. In order to access the ESM equivalent of __dirname in CommonJS, I call...

Jest: Cannot find module 'monaco-editor-core'

I have an reactjs(typescript) app which uses monaco-editor-core, and not monaco-editor, with custom language. Jest tests fails, if i don't mock monaco-editor-core imports, with next error: "Cannot...

You are running the esm-bundler build of Vue. It is recommended to configure your bundler

I am getting this error on my Vue 3 project: You are running the esm-bundler build of Vue. It is recommended to configure your bundler to explicitly replace feature flag globals with boolean...

Issue in deployment heroku - MongooseError: Operation `users.findOne()` buffering timed out after 10000ms

I have deployed my MERN chat application in heroku, it's working fine locally without any issues but having problem in connection to databse in heroku I have checked heroku log My Index.js...

How to fix error "Failed to compile : ./node_modules/@react-leaflet/core/esm/path.js 10:41 Module parse failed: Unexpected token (10:41)"

I am trying to create a react-typescript app along with leaflet. I used the command, npm install leaflet react-leaflet @types/react @types/leaflet --save to install the dependencies. But when I...

Rollup + React 17 with new JSX Transform - "React is not defined"

I'm trying to prototype a microfrontend architecture with Rollup and a couple of create-react-app applications. However when I locally yarn link my external app with the container app, I run into...

totp-generator TypeError: JsSHA is not a constructor

Am trying to build a totp-generator(just like what google timed-base authencator those) using react framework am using this bellstrand module totp-generator to calculate my token but cant seems...

Unknown word error in css file even with css-loader

I am getting a syntax error in one of my css files from monaco-editor in node_modules. It is an unknown word error: > 1 | // Imports | ^ 2 | import ___CSS_LOADER_API_IMPORT___ from...

Typescript definitions in wrong folder using rollup and typescript2

I'm building a package using React, Typescript, Rollup, rollup-plugin-typescript2. While the generated JS files are fine, the generated definition files are in the wrong directory. Current...

Trying to set up swagger ui inside my node.js / express.js project

I'm trying to set up swagger ui in my node.js / express.js project, this is what i've done ( I'm following the tutorial from this website ) package.json { "name": "challenge", "version":...

webpack-cli ReferenceError: require is not defined

The issue is my webpack config uses CommonJS syntax but main code is written in ES6. However based on the tutorials I have seen online, that seems to be the typical setup. So while the error is...

Support ESM in next.config.js

I'm making some optimation on nextjs project and need to has type: 'module' on thepackage.json file. But then got the error Error [ERR_REQUIRE_ESM]: Must use import to load ES...

Circular dependency (?) in library & nodejs library code - Object prototype may only be an Object or null: undefined

I'm using filestack-js in a Rails project which is bundled with Vite. Everything works as expected until I include the ESM module for the filestack-js library, in this case in a StimulusJS...

Error: require() of ES modules is not supported when importing node-fetch

I'm creating a program to analyze security camera streams and got stuck on the very first line. At the moment my .js file has nothing but the import of node-fetch and it gives me an error message....

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" - Firebase

Working through this Full Stack React & Firebase Tutorial and trying to use Firebase Authentication, to create a new user, I am getting the below error. Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No...

node-fetch 3.0.0 and jest gives SyntaxError: Cannot use import statement outside a module

I'm trying to upgrade my api to use node-fetch 3.0.0. Part of the breaking changes in their documentation is that node-fetch is now a pure ESM...

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" main defined in package.json

How can I fix 'Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" main defined in package.json'? How can I fix this error? I've been trying for awhile and had help and we can't figure it out. I...

Error [ERR_UNSUPPORTED_ESM_URL_SCHEME]: Only file and data URLs are supported by the default ESM loader - Vue 3

I get the following error when i want to start my vue 3 typescript project: ERROR Error [ERR_UNSUPPORTED_ESM_URL_SCHEME]: Only file and data URLs are supported by the default ESM loader. On...

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './lib/tokenize' is not defined by "exports" in the package.json of a module in node_modules

This is a React web app. When I run npm start This error occurred > [email protected] start > react-scripts start node:internal/modules/cjs/loader:488 throw e; ^ Error...