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

Failed to resolve entry #1273

Open
anmol-raghuvanshi opened this issue Aug 26, 2023 · 1 comment
Open

Failed to resolve entry #1273

anmol-raghuvanshi opened this issue Aug 26, 2023 · 1 comment

Comments

@anmol-raghuvanshi
Copy link

Hello, i have getting following error

[plugin:vite:import-analysis] Failed to resolve entry for package "@pixiv/types-vrm-0.0". The package may have incorrect main/module/exports specified in its package.json.

I have been using "@pixiv/three-vrm": "^2.0.2", and installed "@pixiv/types-vrmc-vrm-1.0": "^2.0.2", when i try to import as mentioned in migration guide i get above .

What i have been trying is lip and facial expression of VRM model loaded.
Any help would be appreciated.
Thanks in advance

@yue4u
Copy link
Contributor

yue4u commented Aug 29, 2023

@anmol-raghuvanshi

Hi, sorry for the late response. I've tried the latest version of vite and can only reproduce your error if trying to import @pixiv/types-vrmc-vrm-1.0 as value. Please note any packages start with @pixiv/types-vrmc- are type only packages, i.e., should be only imported and used as types.

For example, import type will work,

// this is ok
import type * as V1VRMSchema from '@pixiv/types-vrmc-vrm-1.0';

but if you are trying to use imported type as value, the Failed to resolve entry error will happen.

// this is not ok
import * as V1VRMSchemaAsSomeValue from '@pixiv/types-vrmc-vrm-1.0';
console.log(V1VRMSchemaAsSomeValue)

In the situation you are not using typescript, it's possible to use these packages as following in doc comments.

// @ts-check

/**
 * @type {import('@pixiv/types-vrmc-vrm-1.0').Expression}
 */
const expression = {
    // ...
}

Please take a look of the way you are using the types packages. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants