tweenjs / tween.js

JavaScript/TypeScript animation engine
https://tweenjs.github.io/tween.js/
Other
9.81k stars 1.41k forks source link

[vite] Internal server error: Failed to resolve import "@tweenjs/tween.js/dist" from "src\index.ts". Does the file exist? #654

Closed zhangxinyong12 closed 1 year ago

mk965 commented 1 year ago

You should import like this:

import { Tween, update } from '@tweenjs/tween.js';
achuan9 commented 1 year ago

cd node_modules/@tweenjs/tween.js && pnpm build

trusktr commented 1 year ago

Not very clear what the issue is. It is better if you show some code.

If you are writing something like

import ... from "@tweenjs/tween.js/dist"

then try this instead like @mk965 hinted:

import ... from "@tweenjs/tween.js"

Note, try the new version 21.0.0. import ... from "@tweenjs/tween.js" should work with all modern tools now.

Please re-open if you have more info and it still doesn't work.