Cannot build since test-builder 1.0.2

Hello,

I am using the prosemirror-test-builder dependency to execute Prosemirror tests in an Angular 9 app (through the ng test my_frontend_app --configuration=my_config angular CLI command, which uses webpack behind the scenes). This used to work well until I upgraded to the 1.0.2 version, which raises the following error:

Can't import the named export 'Schema' from non EcmaScript module (only default export is available) 

multiple times (replace ‘Schema’ by ‘Node’ or other).

Going back to 1.0.1 fixes the problem. I there a way I can workraround this?

Thank you.

Ah, prosemirror-test-builder was still using the .mjs extension for its ES module, which greatly confuses webpack. I’ve tagged a version 1.0.3.

Thank you! However when using 1.0.3 I cannot find the builders api anymore. For instance:

const tb = require('prosemirror-test-builder');
const mySchema = tb.builders(schema, {
  xxx: {nodeType: schema.nodes.xxx.name}
});

fails with the error saying that builders is not known.

(works well using 1.0.1 though)

I suppose you need require('prosemirror-test-builder').default, because of poorly conceptualized module system inoperability.

Yes, indeed that fixes the problem. Thanks