1

I'm using locomotive scroll and nuxt3. This is my repo: https://github.com/cyprianwaclaw/nuxt.git

I imported async locomotive-scroll in layouts/scroll and added this layout in main app, but the scrolling is not smooth.

My styleccs are in the assets/css/tailwindcss file.

How can I make the scrolling smooth in my project?

And in my console I have this error:

locomotive-scroll.esm.526a65ed.mjs:7 
    
   Uncaught (in promise) TypeError: Cannot read properties of null (reading 'offsetHeight')
at n.value (locomotive-scroll.esm.526a65ed.mjs:7:11013)
at n.value (locomotive-scroll.esm.526a65ed.mjs:7:10771)
at s.value (locomotive-scroll.esm.526a65ed.mjs:7:29026)
at new s (locomotive-scroll.esm.526a65ed.mjs:7:28450)
at scroll.70d56592.mjs:1:397      
Amy
  • 1,114
  • 13
  • 35
  • Hi, can you give a try to that one? https://stackoverflow.com/q/66423288/8816585 Maybe there are some conflicts with Tailwind? Did you tried without? Also, do you have an error anywhere or found an issue related on the project? – kissu Sep 23 '22 at 08:30
  • yes, in my console I have this error: – Cyprian Wacław Sep 23 '22 at 08:33
  • Feel free to update your question directly. – kissu Sep 23 '22 at 08:34
  • locomotive-scroll.esm.526a65ed.mjs:7 Uncaught (in promise) TypeError: Cannot read properties of null (reading 'offsetHeight') at n.value (locomotive-scroll.esm.526a65ed.mjs:7:11013) at n.value (locomotive-scroll.esm.526a65ed.mjs:7:10771) at s.value (locomotive-scroll.esm.526a65ed.mjs:7:29026) at new s (locomotive-scroll.esm.526a65ed.mjs:7:28450) at scroll.70d56592.mjs:1:397 locomotive-scroll.esm.526a65ed.mjs:7 – Cyprian Wacław Sep 23 '22 at 08:35
  • vercel link: https://nuxt-dun.vercel.app/ – Cyprian Wacław Sep 23 '22 at 08:36
  • Providing the result will not help anyhow here. Especially since we do have an actual error here. Where are you calling `offsetHeight` exactly? – kissu Sep 23 '22 at 08:39
  • offsetHeight is locomotive-scroll file, you would like this error in vercel (link is upper) in console (I don't good speak English) – Cyprian Wacław Sep 23 '22 at 08:55

1 Answers1

0

try add css style in nuxt.confi.ts :

css: [
  '~/assets/css/tailwind.css',
  'locomotive-scroll/dist/locomotive-scroll.css',
],
kissu
  • 40,416
  • 14
  • 65
  • 133
Yawee
  • 1