Questions tagged [mjs]
The mjs tag has no usage guidance.
49
questions
0
votes
0
answers
4k
views
Can't import the named export 'XXX' from non EcmaScript module (only default export is available)
Working on a calendar display for a React project, and after creating this component, I have this error now appearing.
The error, "Failed to compile.
./node_modules/date-fns/intervalToDuration....
-1
votes
1
answer
106
views
Is there a way to convert mjs files to js? [closed]
Is there a way to convert .mjs files to .js? Not all hosts support mjs files yet, so I'd like to convert mjs files to js files.
Background: Mozilla's PDFjs updated their code to use JavaScript modules ...
0
votes
2
answers
42
views
Why is my Node.js code not reaching the unreachable part after processing events with for-await-of loop on EventEmitter?
import { on, EventEmitter } from 'node:events';
import process from 'node:process';
const ee = new EventEmitter();
// Emit later on
process.nextTick(() => {
ee.emit('foo', 'bar');
ee.emit('foo'...
0
votes
0
answers
13
views
New lines from my mdx file are not rendering on my website, how can I fix this?
I'm using markdown files in my Next JS project, but when I view my files on local host there is no spaced between any lines or paragraphs. How can I fix this?
Markdown file:
**Research**
The ...
0
votes
1
answer
15
views
Netbeans 21 and .mjs- filetype
I just installed Netbeans V21 and saw that .mjs- files are not recognized by the spellchecker, even after importing the setup from V20.
Then I opened Tools/ Options/ Miscellaneous/ Files and set "...
0
votes
0
answers
185
views
How to create ES module ('.mjs') migration files through sequelize-cli?
I'm writing PostgreSQL database migrations in my NodeJs project using sequelize-cli and trying to follow ES module syntax in my files.
Unfortunately, I can't find how to enable creation and execution ...
1
vote
1
answer
4k
views
Unrecognized key(s) in object: 'appDir' at "experimental" - Next.js 14.0.4 error
I updated the next.js and appeared an error. I searched that error and I didn't found the solution, even the official website of the next.js.
The error is here:
> [email protected] dev
> next dev
▲ ...
1
vote
1
answer
477
views
Webpack cannot resolve /index.(js|jsx) files when package is type module
I'm pretty new to Webpack configuration and difference between cjs, mjs etc.
When trying to build a component lib bundled by Webpack, im coming across this error when building (webpack command)
...
6
votes
4
answers
3k
views
Angular 17 SSR - how to compile server files (*.mjs) to *.js
my hosting provider requires server files to be compiled to CommonJs and Angular 17 by default compiles files to Module JS *.mjs, I've tried to change the tsconfig.json but it changes the scope for ...
0
votes
0
answers
92
views
JavaScript creating ZIP file from existing folder
Using JSZip, I need to get all items in an already existing folder. so I do a loop over a folder and add all items to the zip object.
Once I have my zip element complete, I start creating my zip file.
...
2
votes
0
answers
179
views
Problem parsing a mjs file with babel in a CRA
I have a project made with CRA where I've imported an external library with this package.json
"type": "module",
"main": "build/index.umd.js",
"module":...
0
votes
0
answers
79
views
Running javascript files without using modules
I'm working on a project in HTML and have been running JavaScript modules from it. However, I'm encountering the error in my browser that CORS is blocking a local file.
I did some research and I heard ...
0
votes
1
answer
534
views
"module has no exports" error - works fine on stackblitz but fails locally
I'm trying to get up and running with shikiji (a rewrite of shiki). As such, I've created this minimal example Next.js 13 project. It's the boilerplate project you get with npx create-next-app@latest ...
1
vote
0
answers
153
views
Error importing mjs file into Typescript: TS2307: Cannot find module '../../env.mjs' or its corresponding type declarations
Using this library: https://env.t3.gg/docs/nextjs to build env validator in nextjs. I am getting following error on "yarn dev": TS2307: Cannot find module '../../env.mjs' or its ...
2
votes
2
answers
2k
views
MIME type of .mjs files is "text/html" when deploying React (ViteJS) app to Azure Kubernetes
I've built a React application utilizing ViteJS with TypeScript. I've built the project using tsc && vite build. I've then built the Docker image based on my Dockerfile:
FROM node:18.12.0
COPY ...