transloco icon indicating copy to clipboard operation
transloco copied to clipboard

Bug(scope): Error [ERR_REQUIRE_ESM] when using with playwright

Open Wandang opened this issue 2 years ago • 0 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Which Transloco package(s) are the source of the bug?

Transloco

Is this a regression?

No

Current behavior

Trying to execute a test with playwright leads to this error:

Error [ERR_REQUIRE_ESM]: require() of ES Module /Users//dev/angular-transloco-playwright-test/angular-transloco-playwright-test/node_modules/@ngneat/transloco/fesm2015/ngneat-transloco.mjs not supported. Instead change the require of /Users//dev/angular-transloco-playwright-test/angular-transloco-playwright-test/node_modules/@ngneat/transloco/fesm2015/ngneat-transloco.mjs to a dynamic import() which is available in all CommonJS modules.

I posted a bug ticket there but they were sending me here: https://github.com/microsoft/playwright/issues/14352#issuecomment-1145466917

Expected behavior

Transloco is loaded and can be used to translate UI elements in e2e spec files

Please provide a link to a minimal reproduction of the bug

https://github.com/Wandang/angular-transloco-playwright-test

Transloco Config

Not relevant

Please provide the environment you discovered this bug in

Transloco: 4.1
Angular: 13
Node: 16.15
Package Manager: npm
OS: macOS

Browser

irrelevant

Additional context

Just execute npx playwright test in the demo project

I would like to make a pull request for this bug

No

Wandang avatar Jun 29 '22 12:06 Wandang