Error [ERR_REQUIRE_ESM]: require() of ES Module
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Anfängerfreundlichkeit
- 35/100
- Issue-Typ
- Bug
- Klarheit
- Muss geklärt werden
- Aktivitätsstatus
- Veraltet
- Tech-Stack
- javascript, node.js
- Bereich
- backend
Rechercherichtung
Beginne damit, den Fehler mit node index.js zu reproduzieren. Untersuche anschließend package.json, cloud/main.js, index.js:36 und den require-Aufruf in node_modules/parse-server/lib/ParseServer.js:146. Vergleiche die Moduleinstellungen mit den gemeldeten ERR_REQUIRE_ESM-Hinweisen und überprüfe, dass das Beispiel ohne den Fehler startet.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Hi Team,
I am facing below error when i run "node index.js"
warn: DeprecationWarning: The Parse Server option 'allowClientClassCreation' default will change to 'false' in a future version.
warn: DeprecationWarning: The Parse Server option 'allowExpiredAuthDataToken' default will change to 'false' in a future version.
warn: DeprecationWarning: The Parse Server option 'encodeParseObjectInCloudFunction' default will change to 'true' in a future version.
Error [ERR_REQUIRE_ESM]: require() of ES Module /home/farhan/parse-server-example/cloud/main.js from /home/farhan/parse-server-example/node_modules/parse-server/lib/ParseServer.js not supported.
main.js is treated as an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which declares all .js files in that package scope as ES modules.
Instead rename main.js to end in .cjs, change the requiring code to use dynamic import() which is available in all CommonJS modules, or change "type": "module" to "type": "commonjs" in /home/farhan/parse-server-example/package.json to treat all .js files as CommonJS (using .mjs for all ES modules instead).
at ParseServer.start (/home/farhan/parse-server-example/node_modules/parse-server/lib/ParseServer.js:146:13)
at async file:///home/farhan/parse-server-example/index.js:36:3 {
code: 'ERR_REQUIRE_ESM'
}
/home/farhan/parse-server-example/node_modules/parse-server/lib/ParseServer.js:146
require(path.resolve(process.cwd(), cloud));
^
Error [ERR_REQUIRE_ESM]: require() of ES Module /home/farhan/parse-server-example/cloud/main.js from /home/farhan/parse-server-example/node_modules/parse-server/lib/ParseServer.js not supported.
main.js is treated as an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which declares all .js files in that package scope as ES modules.
Instead rename main.js to end in .cjs, change the requiring code to use dynamic import() which is available in all CommonJS modules, or change "type": "module" to "type": "commonjs" in /home/farhan/parse-server-example/package.json to treat all .js files as CommonJS (using .mjs for all ES modules instead).
at ParseServer.start (/home/farhan/parse-server-example/node_modules/parse-server/lib/ParseServer.js:146:13)
at async file:///home/farhan/parse-server-example/index.js:36:3 {
code: 'ERR_REQUIRE_ESM'
}
- Vorherrschende Sprache
- JavaScript
- Sterne
- 1.9k
- Forks
- 5.3k
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Entwicklungsumgebung
- Enthält ein Dockerfile oder eine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Kein Beitragsleitfaden
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus parse-community/parse-server-example
-
typo error in README.md fileEvtl. vergeben @Syed25794 hat das vor 1234 Tagen übernommen. Offen
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 65/100
parse-community/parse-server-example#436 · 1 Kommentar ·
-
An error with npm start: Error [ERR_UNSUPPORTED_ESM_URL_SCHEME]: Only URLs with a scheme in: file and data are supported by the default ESM loader. On Windows, absolute paths must be valid file:// URLs. Received protocol 'c:'Evtl. vergeben @rjcodedev hat das vor 1004 Tagen übernommen. Offentype:bug
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 30/100
parse-community/parse-server-example#432 · 17 Kommentare ·
-
type:bug
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 35/100
parse-community/parse-server-example#431 · 3 Kommentare ·
-
type:bug
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 25/100
parse-community/parse-server-example#420 · 1 Kommentar ·
-
Quick-start deployment buttons not workingEvtl. vergeben @gut-puncture hat das vor 152 Tagen übernommen. Offentype:docs
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 35/100
parse-community/parse-server-example#404 · 4 Kommentare · 1 Reaktion ·
Alle Issues in parse-community/parse-server-example
Ähnliche Issues
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
capricorn86/happy-dom#2485 ·
Maintainer antworten meist innerhalb von 2 Tagen
-
Schwierigkeit 2/5 Unter einer Stunde Anfängerfreundlichkeit 74/100
siyuan-note/siyuan#20429 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100
Maintainer antworten meist innerhalb von 2 Tagen
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 72/100
yjh051108/dsh-routing-suite#216 ·
-
[Bug] Completion info popup (.cm-completionInfo) ignores the configured editor fontEvtl. vergeben Ein verknüpfter Pull Request ist offen oder bereits gemergt. Offenbug user-priority/P2
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
t8y2/dbx#11718 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag