Reputation: 103
I am trying to set up the testing environment for my Vite Lit.js project. I have installed WTR with esBuild plugin to handle typescript. When I run my tests I keep gettin the error below.
🚧 Browser logs:
TypeError: Failed to fetch dynamically imported module: http://localhost:8000/test/my-element.test.ts?wtr-session-id=ohiw61aMlyXpLj5BAM5x_
❌ Could not import your test module. Check the browser logs or open the browser in debug mode for more information.
I have tried setting up a clear project with the same structure and src as the official WTR examples for "lit-element-ts-esbuild" but I still have the same issue.
For my vite project, I have installed the recommended vite plugin (@remcovaes/web-test-runner-vite-plugin) but the error message still appears.
Upvotes: 4
Views: 461