You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To execute some preparations we use a helper-package, written in typescript.
The sources of this package work fine when they are part of the source code of my playwright app. - I can import it, so that I can use it as a fixture e.g.
My idea was now to separate that package onto a verdaccio server to make it reusable for other playwright-projects. But here I am in tremendous trouble now.
The package itself works as expected, but after installing it and trying my playwright-app to run with it, I always get:
JavaScript files must end with .mjs to use import.
Interesting - I do not use any js-files.
Nevertheless, my naive approach here was, "ok... then I provide the files also with .mjs-extension." - But this fails as well.
I have read related topics, but I am not able to get it work.
This does not give me a good idea on what you are trying to do - your question seems to be not about Playwright, but about creating a custom typescript package. Node can't execute TypeScript, so there is no such thing as a "custom typescript package". You would need to compile your module into JS, preferably to CJS for better interoperability. I think I have a better idea on the linked issue, so we can continue this conversation there.
Hello!
To execute some preparations we use a helper-package, written in typescript.
The sources of this package work fine when they are part of the source code of my playwright app. - I can import it, so that I can use it as a fixture e.g.
My idea was now to separate that package onto a verdaccio server to make it reusable for other playwright-projects. But here I am in tremendous trouble now.
The package itself works as expected, but after installing it and trying my playwright-app to run with it, I always get:
Interesting - I do not use any js-files.
Nevertheless, my naive approach here was, "ok... then I provide the files also with .mjs-extension." - But this fails as well.
I have read related topics, but I am not able to get it work.
That is my tsconfig.json
That is my config.json
I confess, I am not that experienced with that config-stuff. - What is the best practice to integrate custom typescript packages?
PS: Using .js-extension as recommended here gives:
Error: Cannot find module [...].js
The text was updated successfully, but these errors were encountered: