TypeScript installation works with tests/test.ts
, not tests/test.js
#4341
Labels
bug
Something isn't working
p1-important
SvelteKit cannot be used by a large number of people, basic functionality is missing, etc.
Milestone
Describe the bug
I answered 'yes' to installing with TypeScript, but
yarn test
andnpm test
would bomb with this error:Error [ERR_REQUIRE_ESM] [ERR_REQUIRE_ESM]: Must use import to load ES Module: /Users/joe/repos/cavesite/tests/test.js
I solved the problem by renaming
tests/test.js
totests/test.ts
.The main problem with this is that it sent me for a spin around the Internet trying to figure out how to get things working.
(Aside: I'm still trying to figure out how to run
src/**/*.test.ts
unit tests, via either playwright or jest.)Reproduction
yarn test
ornpm test
.Logs
System Info
Severity
annoyance
Additional Information
No response
The text was updated successfully, but these errors were encountered: