-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Node.js
How frequently does the bug occur?
Always
Description
Due to a misconfiguration of the package.json the ESM bundle is served when requiring from a CommonJS require statement.
Stacktrace & log output
Unable to find source-code formatter for language: shell. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
Error [ERR_REQUIRE_ESM]: require() of ES Module /Users/kraen.hansen/Projects/realm-js/packages/realm/dist/bundle.node.mjs not supported. Instead change the require of /Users/kraen.hansen/Projects/realm-js/packages/realm/dist/bundle.node.mjs to a dynamic import() which is available in all CommonJS modules. at __node_internal_captureLargerStackTrace (node:internal/errors:478:5) at new NodeError (node:internal/errors:387:5) at Module.load (node:internal/modules/cjs/loader:1031:11) at Function.Module._load (node:internal/modules/cjs/loader:868:12) at Module.require (node:internal/modules/cjs/loader:1057:19) at require (node:internal/modules/cjs/helpers:103:18) { code: 'ERR_REQUIRE_ESM' }
Can you reproduce the bug?
Always
Reproduction Steps
No response
Version
v12.0.0-alpha.0
What services are you using?
Local Database only
Are you using encryption?
No
Platform OS and version(s)
Node.js
Build environment
No response
Cocoapods version
No response