smooth-scrolling
smooth-scrolling copied to clipboard
Next.js Compatibility
Trying to use this in a Next.js project and get an error from simply trying to import the package.
SyntaxError: Cannot use import statement outside a module
Appears that it doesn't have Node.js-compatible source files — trying to run ES Modules in a Node.js environment.
I would love to try this out in my Next.js projects.
This is weird indeed... I'm not using Next.js so I'm not sure. I guess it should support ES6 import statements. My wild guess would be to just copy the content of index.js and import it from your source files instead of npm... Sorry for not having a proper solution for now!
The package uses import
but has no "type": "module"
in the package.json: https://stackoverflow.com/a/64655153