kazijawad / react-use-scroll-snap

A React Hook for JavaScript scroll snapping.

Home Page:https://npmjs.com/package/react-use-scroll-snap

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Must use import to load ES Module

victorpavlenko opened this issue · comments

commented

Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: /Users/sasa/web-app/node_modules/react-use-scroll-snap/index.js
require() of ES modules is not supported.
require() of /Users/sasa/web-app/node_modules/react-use-scroll-snap/index.js from /Users/sasa/web-app/dist/assets/server.js is an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which defines all .js files in that package scope as ES modules.
Instead rename index.js to end in .cjs, change the requiring code to use import(), or remove "type": "module" from /Users/sasa/web-app/node_modules/react-use-scroll-snap/package.json.

Hi, this package is setup as an ES Module. I have no plan to support CommonJS. If you can provide a code sample of your project, I can help debug, otherwise I'll close this issue.