web icon indicating copy to clipboard operation
web copied to clipboard

`visualDiff` of `@web/test-runner-visual-regression` can't be imported

Open jeripeierSBB opened this issue 1 year ago • 7 comments

Since version 0.10.0 of @web/test-runner-visual-regression typescript complains when trying to import visualDiff like: import { visualDiff } from '@web/test-runner-visual-regression'; (suggested by docs).

We assume that the index.d.ts which newly contains .mjs extension (export * from './browser/commands.mjs';) causes the problem. If the extension is removed, it works again.

Dependency update PR on our side with failing typescript: PR: https://github.com/sbb-design-systems/lyne-components/pull/3069 Logs: https://github.com/sbb-design-systems/lyne-components/actions/runs/10811479138/job/29990965173?pr=3069

jeripeierSBB avatar Sep 11 '24 13:09 jeripeierSBB

Is there any update or workaround for this?

I guess I can do a patch package...

My patch for future reference:

diff --git a/node_modules/@web/test-runner-visual-regression/index.d.ts b/node_modules/@web/test-runner-visual-regression/index.d.ts
index f540538..5198ffa 100644
--- a/node_modules/@web/test-runner-visual-regression/index.d.ts
+++ b/node_modules/@web/test-runner-visual-regression/index.d.ts
@@ -1,2 +1,2 @@
 // this file is autogenerated with the generate-mjs-dts-entrypoints script
-export * from './browser/commands.mjs';
+export * from './browser/commands';

melink14 avatar Dec 19 '24 10:12 melink14

Is there any update or workaround for this?

I guess I can do a patch package...

My patch for future reference:

diff --git a/node_modules/@web/test-runner-visual-regression/index.d.ts b/node_modules/@web/test-runner-visual-regression/index.d.ts index f540538..5198ffa 100644 --- a/node_modules/@web/test-runner-visual-regression/index.d.ts +++ b/node_modules/@web/test-runner-visual-regression/index.d.ts @@ -1,2 +1,2 @@ // this file is autogenerated with the generate-mjs-dts-entrypoints script -export * from './browser/commands.mjs'; +export * from './browser/commands';

@melink14 Could you open a pull request that fixes it pls? I would but preferably you should as you contributed the change...

paladox avatar Apr 26 '25 12:04 paladox

@paladox My policy is not to open pull requests unless there is acknowledgement from the maintainers. This repo has a large number of open PRs and so I think it's worth waiting for some kind of message that a PR will be looked at before sending it.

melink14 avatar May 13 '25 07:05 melink14

Bumping this issue again. Is the team open to a PR for this?

melink14 avatar Jun 13 '25 08:06 melink14

https://github.com/modernweb-dev/web/pull/2932 was merged, so I presume you could open a pr and ping one of the committers?

paladox avatar Jun 13 '25 08:06 paladox

I've done https://github.com/modernweb-dev/web/pull/2963 which credits you for the fix.

paladox avatar Jun 13 '25 08:06 paladox

@bashmish can you share the process of getting this issue resolved?

caseyisonit avatar Jul 16 '25 15:07 caseyisonit