8000 Vitest - Cannot find package '@monicon/runtime' · Issue #60 · oktaysenkan/monicon · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

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

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

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

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

timmaier opened this issue Jan 2, 2025 · 4 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
@itsjavi
Copy link
itsjavi commented Feb 24, 2025

I've tried Monicon with React Router v7.2.x and Vite and I got the same error.

@JakeSiewJK64
Copy link
JakeSiewJK64 commented Feb 24, 2025

@oktaysenkan hello, im having the exact same error when running vitest, except im on vite react.

my package versions
dependency:

"@monicon/react": "^1.2.2",
"@monicon/vite": "^1.2.2",

dev dependency

"vite": "^6.0.5",
"vitest": "^3.0.5"

unit test

import Monicon from "@monicon/react";
import { describe, it } from "vitest";
import { render } from "@testing-library/react";

describe("icon", () => {
  it("icon", () => {
    render(<Monicon name="lucide:edit" />);
  });
});

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

4 participants
0