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

SyntaxError: Unexpected token 'export'

Open TheHoltz opened this issue 3 years ago • 7 comments

I'm using node version v14.15.4 and NextJS 12.0.7, with react 17.0.2, and when I try to import anything, it gives me that error:

image

Did anyone manage to solve it?

TheHoltz avatar Mar 02 '22 18:03 TheHoltz

Same issue here

donnes avatar Mar 09 '22 20:03 donnes

same issue

miladezzat avatar Mar 10 '22 09:03 miladezzat

@EmaSuriano

miladezzat avatar Mar 10 '22 12:03 miladezzat

yep, me too,

uyendo-tmrw-vn avatar Apr 01 '22 08:04 uyendo-tmrw-vn

You need to use something like

//... next.config.js

const withTM = require('next-transpile-modules')(['react-scroll-section']);

module.exports = withTM(nextConfig);

If you don't use next.js, find a way how to transpile modules with your build system

easylaneof avatar Apr 05 '22 15:04 easylaneof

any updates on this @EmaSuriano ?

bogdancss avatar Oct 12 '22 22:10 bogdancss

Hello guys, I updated the library to use Vite to compile the project and the typing issue should be fixed.

Can you confirm this @bogdancss ?

EmaSuriano avatar Oct 16 '22 09:10 EmaSuriano