Skip to content
This repository was archived by the owner on Jun 9, 2022. It is now read-only.
This repository was archived by the owner on Jun 9, 2022. It is now read-only.

Fastclick on NuxtJS #606

@shidcordero

Description

@shidcordero

I am trying to add this library to nuxt js.

What I have now is a file under plugins/fastclick.js

import FastClick from 'fastclick'

export default ({ document }) => {
  FastClick.attach(document.body)
}

which i use to import that one in my nuxt config using

plugins: [
    { src: '~/plugins/fastclick.js' }
  ]

but the result is I am getting ReferenceError: navigator is not defined error

I tried to provide the file using webpack.ProvidePlugin

 build: {
    plugins: [new webpack.ProvidePlugin({ FastClick: 'fastclick' })]
 }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions