While investigating why we were having resolve failures on windows when using the exports key in our package.json I have discovered that the published built output has forced the import of join, relative and basename to be from path.posix instead of just path.
This has caused us issues where Vite is unable to resolve node modules inside packages containing exports: { ".". { ... } } with the errors
[vite] Internal server error: Missing "./react-dom" in "@local/lib-name" package
When I edit node_modules/vite-tsconfig-paths/dist/index.js and replace var join = _path.posix.join with var join = _path.join everything works as expected.
While investigating why we were having resolve failures on windows when using the
exports
key in ourpackage.json
I have discovered that the published built output has forced the import ofjoin
,relative
andbasename
to be frompath.posix
instead of justpath
.This has caused us issues where Vite is unable to resolve node modules inside packages containing
exports: { ".". { ... } }
with the errors[vite] Internal server error: Missing "./react-dom" in "@local/lib-name" package
When I edit
node_modules/vite-tsconfig-paths/dist/index.js
and replacevar join = _path.posix.join
withvar join = _path.join
everything works as expected.