Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vitest - Cannot find package '@monicon/runtime' #60

Open
timmaier opened this issue Jan 2, 2025 · 2 comments
Open

Vitest - Cannot find package '@monicon/runtime' #60

timmaier opened this issue Jan 2, 2025 · 2 comments
Labels
bug Something isn't working

Comments

@timmaier
Copy link

timmaier commented Jan 2, 2025

I highlighted this issue in #54 but since that's now been closed I retested with monicon v1.1.1

When running the vitest vue-monicon-test I get the above error:

Screenshot 2025-01-02 at 3 28 17 PM

Environment:
npm: v10.7.0
node: v20.15.1

Here is the test project: https://github.com/timmaier/vue-monicon-test

To replicate clone project and run:

npm install
npm run test:unit
@oktaysenkan
Copy link
Owner

oktaysenkan commented Jan 2, 2025

I don't know why vitest doesn't run resolveId function

Solution

main.ts

import { createApp } from "vue";
import Monicon from "@monicon/vue";

import App from "./App.vue";

import "./style.css";

const app = createApp(App);

app.use(Monicon);

app.mount("#app");

App.vue

<script setup lang="ts"></script>

<template>
  <Monicon name="mdi:home" />
  <monicon name="mdi:home" />
</template>

@oktaysenkan oktaysenkan added the bug Something isn't working label Jan 2, 2025
@timmaier
Copy link
Author

timmaier commented Jan 2, 2025

Yeah it's very odd only in the vitest do I actually encounter the issue. All works fine in dev and in production, just our CI runs a few vitests which I've disabled for now.

@oktaysenkan oktaysenkan changed the title Error: Cannot find package '@monicon/runtime' imported from /vue-monicon-test/node_modules/@monicon/vue/dist/monicon.mjs Vitest - Cannot find package '@monicon/runtime' Jan 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants