angelomelonas / vue-scroll-snap

A super simple Vue component that allows fullscreen and horizontal scroll snapping.
MIT License
31 stars 10 forks source link

Problems using with Nuxt #1

Open Clex1o1 opened 5 years ago

Clex1o1 commented 5 years ago

Hey, I have a problem using your plugin inside my Nuxt project. Unexpected token < Sadly, I do not have more information about the error, at the moment.

angelomelonas commented 5 years ago

Hi @Clex1o1. I am sorry to hear you are experiencing issues with this plugin within your Nuxt project. Unfortunately, I have never used Nuxt before, so I have no clue how to go about solving your issue. Perhaps you can point me to the project where you are experiencing the issue and I can have a look?

csoalhat commented 5 years ago

Hey, have any of you found a solution for this problem? Or an alternative? I am trying to use your plugin as well with Nuxt but i'm running into the same error :(

angelomelonas commented 5 years ago

Hi @csoalhat, I have, unfortunately, not yet had time to work on this issue. Like I told @Clex1o1, if you are interested in attempting to implement vue-scroll-snap for Nuxt, you are more than welcome. I will try and assist if you do.

AeonFr commented 4 years ago

I'm using vue-scroll-snap in nuxt (create-nuxt-app using a SPA) and don't seem to have any issue.

AeonFr commented 4 years ago

Following on this issue:

Some configurations from create-nuxt-app include purgeCSS. The plug-in doesn't detect classes dynamically loaded, and, apparently, it doesn't detect classes loaded using plug-ins either.

Either way, if the npm run generate or npm run build command outputs a style-less scroll container, this might be the fix:

Add this lines to your nuxt.config.js

//...
purgeCSS: {
    whitelist: [
      'scroll-snap-container',
      'fullscreen',
      'horizontal',
   ]
//...

Note, this is not related to the original issue, just thought it might be useful for someone so I'm putting it for future reference.

CarlosWosiak commented 3 years ago

I 'solved' by copying the content from src/VueScrollSnap.vue and making a component from it in my own project.

I may miss some future update, but it is better than being unable to use it because I use Nuxt. :thinking:

kirillkushpel commented 3 years ago

I 'solved' by copying the content from src/VueScrollSnap.vue and making a component from it in my own project.

I may miss some future update, but it is better than being unable to use it because I use Nuxt.

Same story. I've ported my 'clone' to TS, works ok. Strange bug though...