dfinity / agent-js

A collection of libraries and tools for building software around the Internet Computer, in JavaScript.

Home Page:https://agent-js.icp.xyz

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Module parse failed: Unexpected token in NextJS

luco opened this issue · comments

I'm getting this error in NextJS:

error - ./node_modules/@dfinity/agent/lib/esm/index.js
Module parse failed: Unexpected token (12:9)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
| export * from './utils/bls';
| export * from './utils/buffer';
> export * as polling from './polling';

Any thoughts?

"@dfinity/agent": "^0.13.1",
"@dfinity/candid": "^0.13.1",
"next": "10.2.3",

Found it. ES Modules are supporter on next@12+ only.