Skip to content

Conversation

@danielgamage
Copy link
Member

Package type

so 2be9e21 is the output of playwright's npm init command, but it was unhappy with our package.json having "type": "module".

npx playwright test output
(node:83172) ExperimentalWarning: --experimental-loader is an experimental feature. This feature could change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
Error: playwright.config.ts: Cannot import a typescript file from an esmodule.
================================================================================
Make sure that:
  - you are using Node.js 16+,
  - your package.json contains "type": "module",
  - you are using TypeScript for playwright.config.ts.
================================================================================

...

i tried a whole bunch of weird things to get around the error, like precompiling the typescript to js in a test-out dir, but ran into other issues with that (it couldn't find any tests :o)

removing "type": "module" from our package.json works fine for the test, but we still want it for when we publish to npm. open to ideas about how we can make it work for both cases!

Storybook

got the web component tests working, using storybook as the reference for it, but it only works when storybook is already running. otherwise it takes SO long to boot up.

we could precompile the storybook in ci, then reference the static html file in the webserver (we might need to do this to host the storybook anyways), or write a custom html page. both seem complicated, but also open to ideas on this front

@danielgamage danielgamage requested a review from mikabusante May 17, 2022 06:03
@mikabusante
Copy link
Contributor

Error: playwright.config.ts: Cannot import a typescript file from an esmodule.

trying to repro -- this error comes up when adding "type": "module" back to the package.json and then running npx playwright test ya?

@mikabusante
Copy link
Contributor

Screen Shot 2022-05-17 at 1 59 57 PM

Also after adding back "type": "module", I saw this error, but after removing the Page import, the tests run and pass??

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants