modosc/global-jsdom

global-jsdom/register has invalid mjs import syntax

Closed this issue · 4 comments

import jsdom from '.'; should be changed to import jsdom from './index.mjs';

Suffix-less imports aren't allowed in modules unless one explicitly enables the node-resolution-algorithm.

This currently fails with:

Error [ERR_UNSUPPORTED_DIR_IMPORT]: Directory import 'PATH/node_modules/global-jsdom/esm/' is not supported resolving ES modules imported from PATH/node_modules/global-jsdom/esm/register.mjs

thanks for the report - can you add a repro test for this in the examples/ directory? i thought this was already covered but i must be missing a usage pattern.

No problem, repro added in #85

hey @pearofducks can you check out the 8.0.0-beta.0 i just published on npm? it includes the specs from #85 and should solve those issues.

published 8.0.0 on npm, lmk if you have any issues!