auto-playwright
auto-playwright copied to clipboard
Rollback to module-name import to fix defaults issue
Why ?
Based on the official docs of sanitize-html we need do the following:
If esModuleInterop=true is not set in your tsconfig.json file, you have to import it with:
import * as sanitizeHtml from 'sanitize-html';
Problem:
- Currently, we use default import (eg: import sanitizeHtml from 'sanitize-html') and the resulting js bundle currently would look for the following, which is wrong I assume :
Fix:
- So a module-name import (* as module-name) would result in the right invocation like the following:
Connected issue https://github.com/lucgagan/auto-playwright/issues/36
I have used below import statement but still facing the same issue.
I have used below import statement but still facing the same issue.
Did you make a local build and use that build ?
Local build you mean the sanitize-html installation into the libraries? If so, yes. Using "npm install sanitize-html".
Afaik, this should work as I tested it locally and also using an npm build.
@lucgagan would be nice to have this in sooner cos the main currently breaks.
Afaik, this should work as I tested it locally and also using an npm build.
@lucgagan would be nice to have this in sooner cos the main currently breaks.
@rajeshdavidbabu , can you help me with the steps how you made the local build of the sanitize-html? bcz still am facing the issue.
Anyone helping me here?
@prathyusha586-0408 okay this is not yet merged so alternatively you can do the following:
- make this change and
I have used below import statement but still facing the same issue.
yeah are you using the local auto or the auto from npm ?
Go to the file where you use import auto from 'auto-playwright' and change it to import auto from '../<your local path to auto.ts>'
Hi folks,
Wondering if this fix will be merged soon, I am working on a POC and this tool looks very interesting.
Thanks for all your effort!
Please merge the fix, guys. This is blocker for running tests.
@lucgagan let me know if there is something wrong with this one. If not we have to merge it inorder to unblock users.
@prathyusha586-0408 okay this is not yet merged so alternatively you can do the following:
- make this change and
I have used below import statement but still facing the same issue.
yeah are you using the local auto or the auto from npm ?
Go to the file where you use
import auto from 'auto-playwright'and change it toimport auto from '../<your local path to auto.ts>'
@rajeshdavidbabu , i have tried as mentioned but getting below error:
I tried to use auto-playwright but also ran into this issue. What is holding this up?
@lucgagan When can a new release/npm package version be expected?
I still can't get this to work out of the box. Like the others, I am getting: TypeError: Cannot read properties of undefined (reading 'defaults')
I'm also still getting this error.
I'm still getting this error too
I've revert the sanitizeHtml.ts import from import * as sanitizeHtml from 'sanitize-html'; to import sanitize from "sanitize-html";
And, I tested it locally and also using an npm build.
Can you get this deployed? this not working with me.
I'm not able to use this package, can you @lucgagan please fix it?
:tada: This PR is included in version 1.16.1 :tada:
The release is available on:
Your semantic-release bot :package::rocket:

