question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Question] Can someone help with Unknown file extension ".svelte" error for component test?

See original GitHub issue

Context:

  • Playwright Version: 1.25.1
  • Operating System: Ubuntu 22.04.1 (WSL2 - Windows 11)
  • Node.js version: 16.17.0
  • Browser: All
  • Extra: SvelteKit

Hi guys, can someone help with the issue below? I’m not used to Javascript/Node or anything related to frontend.

I have this project (for study) with KoaJS for the backend, SvelteKit for the frontend and Playwright to do all API/E2E/Component tests.

I tried to setup the Component Test for the Button.svelte component but here is the error is occurring. Thanks in advance.

> git clone https://github.com/ltsuda/learning-tests.git
> git switch test/initial-component
> npm i
> npx playwright install
> npm run test-ct

> learning-tests@1.0.0 test-ct
> playwright test -c playwright-ct.config.js


Running 0 tests using 0 workers
TypeError: Unknown file extension ".svelte" for /home/ltsuda/developer/learning-tests/frontend/src/components/button/Button.svelte

    at async Promise.all (index 1)

=================
 no tests found.
=================


  1 error was not a part of any test, see above for details

To open last HTML report run:

  npx playwright show-report

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:12 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
cheapCodercommented, Aug 25, 2022

you can try to use npm init playwright@latest -- --ct to generate the config. see here

and you can add vite config here instead of vite.config.js image

0reactions
ltsudacommented, Nov 7, 2022

Thanks for the message, I have try again sometime. Whenever you guys want to close this, it’s fine for me. If I have any other problem again, I can open a new issue. Thanks again for the help 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeError: Unknown file extension ".svelte" : r/sveltejs - Reddit
In my svelte project, I am using TypeScript, vite and vitest When I included a 3rd party svelte module layercake , my unit...
Read more >
using multiple imports in content script, only one causes ...
I 'm working on a chrome browser extension. The error only appears in the content script. I have slightly modified this typescript file:...
Read more >
Docs • Svelte
Complete documentation for Svelte.
Read more >
Componentizing our Svelte app - Learn web development
But how do you know what should be split into its own component? There are no hard rules for this. Some people prefer...
Read more >
Full Stack SvelteKit For Beginners - Joy of Code
A basic understanding of JavaScript and Svelte helps - I made SvelteKit For ... for the error.svelte and layout.svelte components you're going to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found