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

v 0.2.26 : 'TinyEmitter' exporting problem with create-react-app #76

Closed
abirtasrif opened this issue Dec 17, 2022 · 6 comments
Closed

Comments

@abirtasrif
Copy link

Description
Though its working perfectly with version 0.2.21 . My dev-server returning below error with version 0.2.26 -
./node_modules/@studio-freight/lenis/dist/lenis.mjs
Can't import the named export 'TinyEmitter' from non EcmaScript module (only default export is available)

Below is the hook code that used-
import { useEffect } from "react";
import Lenis from "@studio-freight/lenis";

export const useSmoothScroll = () =>
const lenis = new Lenis({
duration: 1.5,
easing: (t) => Math.min(1, 1.001 - Math.pow(2, -10 * t)),
direction: "vertical",
smooth: true,
});

useEffect(() => {
function raf(time) {
lenis.raf(time);
requestAnimationFrame(raf);
}

requestAnimationFrame(raf);
}, []);
};

@clementroche
Copy link
Member

clementroche commented Dec 17, 2022

This seems to be a common issue from create-react-app
Sources:
-motiondivision/motion#1307
-facebook/create-react-app#10356

You can look for solution on those threads, one from Framer suggests to use create-react-app@next

@BleXor
Copy link

BleXor commented Dec 19, 2022

@abirtasrif

Hello, I've had similar issue in Vue/Nuxt - solved thanks to this solution: vuejs/pinia#675 (comment)

Maybe it can help your case too.

@clementroche
Copy link
Member

@abirtasrif any news, is it fixed ?

@abirtasrif
Copy link
Author

abirtasrif commented Jan 4, 2023

@abirtasrif any news, is it fixed ?

@clementroche No, but I've used the previous version of lenis which working fine.

@clementroche
Copy link
Member

clementroche commented Jan 17, 2023

@abirtasrif Can you try again with v1.0.0-dev.5 ?

@abirtasrif
Copy link
Author

@clementroche lenis 0.2.28 is working fine.

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

3 participants