Closed Mehdi-Hp closed 9 months ago
can you share a sample repo or stackblitz ?
Turns out it was because of my resolve.extensions
config in vite.config.ts
.
Before → resolve: { extensions: ['.js', '.ts', '.vue', '.css', '.postcss'] }
After → resolve: { extensions: ['.js', '.ts', '.vue', '.css', '.postcss', '.mjs'] }
The default value also works, as it sets to ['.mjs', '.js', '.mts', '.ts', '.jsx', '.tsx', '.json']
Thank you for writing wonderfully detailed explanations.
Describe the bug
Vite throws and error that says:
It happens for
PresenceGroup.vue
/Presence.vue
/Motion.vue
.If I add extension to the import statement and change
import { presenceId } from '../context'
toimport { presenceId } from '../context.mjs'
, it workes.This is probably an issue with
unbuild
package, but seems to be fixed in version 2.0.0 and I couldn't figure out what version you're using to build the lib.https://github.com/unjs/mkdist/issues/45 https://github.com/unjs/unbuild/issues/83
System Info
Used Package Manager
pnpm
Validations