Questions tagged [mjs]
40 questions
0
votes
1 answer
Error [ERR_REQUIRE_ESM]: require() of ES Module when running `prisma db seed `
I have a project that is using TypeScript, Prisma & NextJS.
I want to see my database with prisma using the yarn prisma db seed command.
However, I am facing issues.
The problem is the file that I am using to seed my database prisma/seed.ts is using…

mcclosa
- 943
- 7
- 29
- 59
0
votes
1 answer
Not sharing single instance of jQuery/simple assignment failing?
I don't know how to explain this one. I'm trying to debug import 'datatables.net' isn't setting $.fn.dataTable. My theory was that I have 2 copies of jquery.
To debug I added
$.poop = 345
$.fn.somethingUnique = 123
before
import factory from…

mpen
- 272,448
- 266
- 850
- 1,236
0
votes
0 answers
Angular project files extension changes on Migration from view engine to ivy angular 13
I have few angular libraries in my angular project. We will rollup all the files contains code related to my components, services, libraries and generate a loader file. Also there is a libs file that is generated using rollup with all the third…

bvakiti
- 3,243
- 4
- 17
- 26
0
votes
0 answers
async function wont break node.js (.mjs)
I'm trying to pause this function using the breakTheLoop var but it wont work.
This is the code if anyone could help me out
`
async afk(message) {
var breakTheLoop = false;
while (!breakTheLoop) {
await new…

Lil Poop
- 1
0
votes
1 answer
Unable to build lambda with webpack and fontkit
I am trying to add PDF generation to my mailer script implemented as AWS Lambda function. It is working fine locally, etc. When I am packing it with webpack 4, it does not work.
My webpack config is below:
'use strict';
const webpack =…

Igor Shmukler
- 1,742
- 3
- 15
- 48
0
votes
0 answers
Unable to load .mjs file and run tests with Mocha
I am unable to load an .mjs file and run tests with mocha.
I have tried mocha v.7.2.0 with flag --experimental-modules and v.10.0.0 without flag.
I am using node v.14.15.4.
The import statement that I have in my code to test is:
import * as XLSX…

Marco Faustinelli
- 3,734
- 5
- 30
- 49
0
votes
1 answer
Import a function in a .mjs script
Need some help with using a .mjs script and .js as well.
I have one script.mjs file that looks like this. Simplifying here (the script needs to be .mjs file)
import test from './test.js';
test();
and test.js looks like this. Again simplifying…

AlreadyLost
- 767
- 2
- 13
- 28
0
votes
1 answer
Angular Apollo V3 - Jest error: Cannot find module 'apollo-angular'
I recently updated angular apollo from 2.6.0 to the v3.0.0 and this update broke my tests.
I am using jest for my unit tests, while the app compiles and runs fine, my tests are unable to import any dependency from 'apollo-angular', and I get errors…

Flavien Volken
- 19,196
- 12
- 100
- 133
0
votes
1 answer
[react]Getting error code HTTP/1.1 500 Internal Server Error when testing app.post to create a database entry
I am trying to build a website that displays information from a database. My controller file has the code
import express from 'express';
import * as exercises from '../REST API/exercises_model.mjs';
const PORT = 3000;
const app =…

310ToPoona
- 21
- 6
0
votes
1 answer
Is there a way to show Intellisense autocomplete of classes that are imported to .js
I have 2 files, module.mjs and project.js. In module.mjs there are all functions and classes used in project.js file.
My problem is that I can't see class methods or suggestions or even class suggestions in project.js file, that are imported from…

Shammz
- 1
- 2