Skip to content

Rich-Harris/vite-ssr-load-errors

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vite-ssr-load-errors

Repro for what I think is a bug with Vite's ssrLoadModule. If I import() a module that errors upon evaluation, the promise returned from import() rejects. I'd expect the same outcome from ssrLoadModule, but instead the promise resolves to an empty module, and the only way to figure out if an error occurred is by inspecting the module (assuming you know what shape it should have). There's no way to get hold of the error itself.

To test — clone this repo, npm install, then:

node test-import.js # error is thrown, as expected
node test-vite.js   # error is swallowed

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published