You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As of #4187, which landed in v33.0.0, matrix-js-sdk is built into an ECMAScript module (ie, one which uses import {foo} from "bar" rather one that uses const {foo} = require("bar")).
This has broken things for people that attempt to import the SDK in a CommonJS environment, including one of our own examples.
Specifically, it results in this error:
(node:55093) Warning: To load an ES module, set "type": "module" in the package.json or use the .mjs extension.
(Use `node --trace-warnings ...` to show where the warning was created)
/home/rav/work/matrix-js-sdk/examples/node/node_modules/matrix-js-sdk/lib/index.js:17
import * as matrixcs from "./matrix";
^^^^^^
SyntaxError: Cannot use import statement outside a module
at wrapSafe (node:internal/modules/cjs/loader:1350:18)
at Module._compile (node:internal/modules/cjs/loader:1379:20)
at Module._extensions..js (node:internal/modules/cjs/loader:1518:10)
at Module.load (node:internal/modules/cjs/loader:1249:32)
at Module._load (node:internal/modules/cjs/loader:1065:12)
at Module.require (node:internal/modules/cjs/loader:1271:19)
at require (node:internal/modules/helpers:123:16)
at Object.<anonymous> (/home/rav/work/matrix-js-sdk/examples/node/app.js:3:11)
at Module._compile (node:internal/modules/cjs/loader:1434:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1518:10)
Node.js v22.2.0
The text was updated successfully, but these errors were encountered:
As of #4187, which landed in v33.0.0,
matrix-js-sdk
is built into an ECMAScript module (ie, one which usesimport {foo} from "bar"
rather one that usesconst {foo} = require("bar")
).This has broken things for people that attempt to import the SDK in a CommonJS environment, including one of our own examples.
Specifically, it results in this error:
The text was updated successfully, but these errors were encountered: