emailjs-com/emailjs-sdk

Unable to import into nextjs

Closed this issue · 2 comments

image
This is what I'm trying to import.

And these are the errors I'm getting:
image

/home/kmk/sra/sra-website/node_modules/emailjs-com/es/index.js:1
import { init } from './methods/init/init';
       ^

SyntaxError: Unexpected token {
    at Module._compile (internal/modules/cjs/loader.js:723:23)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Module.require (internal/modules/cjs/loader.js:692:17)
    at require (internal/modules/cjs/helpers.js:25:18)
    at eval (webpack-internal:///emailjs-com:1:18)
    at Object.emailjs-com (/home/kmk/sra/sra-website/.next/server/pages/contactus.js:138:1)
    at __webpack_require__ (/home/kmk/sra/sra-website/.next/server/pages/contactus.js:23:31)

Solved by using next-transpile-modules, apologies for disturbing.

Hey! Can you help me out for a sec? Where do you exactly load the config from next-transpile-modules? Thanks in advance!