unjs / unbuild

📦 An unified javascript build system
MIT License
2.19k stars 84 forks source link

Internal server error: Failed to resolve import "../context" #358

Closed Mehdi-Hp closed 5 months ago

Mehdi-Hp commented 5 months ago

Environment

Node: v20.9.0 Vite: v5.0.11 @oku-ui/motion: 0.3.2

Describe the bug

Vite throws and error that says:

[plugin:vite:import-analysis] Failed to resolve import "../context" from "../node_modules/.pnpm/@oku-ui+motion@0.3.2_vue@3.4.6/node_modules/@oku-ui/motion/dist/component/PresenceGroup.vue". Does the file exist?

It happens for PresenceGroup.vue/Presence.vue/Motion.vue.

If I add extension to the import statement and change import { presenceId } from '../context' to import { presenceId } from '../context.mjs', it workes.

Additional context

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

Logs

No response

Mehdi-Hp commented 5 months ago

This shouldn't be here 🤦🏻 I'm sorry.