react-scroll-section icon indicating copy to clipboard operation
react-scroll-section copied to clipboard

ScrollingProvider import declaration error

Open senixcode opened this issue 4 years ago • 3 comments

I am trying to implement it in a nextjs project with ts and I encountered this error when I am running your README(doc) example. I am using yarn

C:\Users\senixcode\Desktop\Projects\my-github-clone\My-web\node_modules\react-scroll-section\lib\index.js:1
import ScrollingProvider from './ScrollingProvider';
^^^^^^

SyntaxError: Cannot use import statement outside a module
    at wrapSafe (internal/modules/cjs/loader.js:1047:16)
    at Module._compile (internal/modules/cjs/loader.js:1097:27)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1153:10)
    at Module.load (internal/modules/cjs/loader.js:977:32)
    at Function.Module._load (internal/modules/cjs/loader.js:877:14)
    at Module.require (internal/modules/cjs/loader.js:1019:19)
    at require (internal/modules/cjs/helpers.js:77:18)
    at Object.react-scroll-section (C:\Users\senixcode\Desktop\Projects\my-github-clone\My-web\.next\server\pages\index.js:227:18)
    at __webpack_require__ (C:\Users\senixcode\Desktop\Projects\my-github-clone\My-web\.next\server\pages\index.js:23:31)
    at Module../src/main.tsx (C:\Users\senixcode\Desktop\Projects\my-github-clone\My-web\.next\server\pages\index.js:146:78)
    at __webpack_require__ (C:\Users\senixcode\Desktop\Projects\my-github-clone\My-web\.next\server\pages\index.js:23:31)
    at Module../pages/index.tsx (C:\Users\senixcode\Desktop\Projects\my-github-clone\My-web\.next\server\pages\index.js:107:67)
    at __webpack_require__ (C:\Users\senixcode\Desktop\Projects\my-github-clone\My-web\.next\server\pages\index.js:23:31)
    at C:\Users\senixcode\Desktop\Projects\my-github-clone\My-web\.next\server\pages\index.js:91:18       
    at Object.<anonymous> (C:\Users\senixcode\Desktop\Projects\my-github-clone\My-web\.next\server\pages\index.js:94:10)
    at Module._compile (internal/modules/cjs/loader.js:1133:30)

senixcode avatar Feb 11 '21 05:02 senixcode

Did you find a solution?

marianocodes avatar May 12 '21 22:05 marianocodes

I used the src directly and it worked but I don't really use it anymore.

senixcode avatar May 12 '21 22:05 senixcode

I have the same error.. Does anyone have a solution?

jzambrano12 avatar Aug 07 '21 11:08 jzambrano12

Hello guys,

This issue should be fixed after the latest update.

I will proceed to close the issue, feel free to re-open the issue in case there is something missing.

EmaSuriano avatar Oct 16 '22 09:10 EmaSuriano

same issue while ssr

mariojfduarte avatar Oct 18 '23 08:10 mariojfduarte