atanasster/grommet-controls

Not working in next.js

quorth0n opened this issue · 3 comments

Running in next.js I get:

/home/lain/repos/ethflip-sample/node_modules/grommet-controls/dist/index.js:1
export * from './components/Avatar';
^^^^^^

SyntaxError: Unexpected token 'export'
    at wrapSafe (internal/modules/cjs/loader.js:979:16)
    at Module._compile (internal/modules/cjs/loader.js:1027:27)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
    at Module.require (internal/modules/cjs/loader.js:952:19)
    at require (internal/modules/cjs/helpers.js:88:18)
    at eval (webpack-internal:///grommet-controls:1:18)
    at Object.grommet-controls (/home/lain/repos/ethflip-sample/.next/server/pages/index.js:161:1)
    at __webpack_require__ (/home/lain/repos/ethflip-sample/.next/server/pages/index.js:23:31)
    at eval (webpack-internal:///./pages/index.js:12:74)
    at Module../pages/index.js (/home/lain/repos/ethflip-sample/.next/server/pages/index.js:128:1)
    at __webpack_require__ (/home/lain/repos/ethflip-sample/.next/server/pages/index.js:23:31)
    at /home/lain/repos/ethflip-sample/.next/server/pages/index.js:91:18
    at Object.<anonymous> (/home/lain/repos/ethflip-sample/.next/server/pages/index.js:94:10)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
/home/lain/repos/ethflip-sample/node_modules/grommet-controls/dist/index.js:1

Could CommonJS exports be added?

Hi @quorth0n ,

The commonjs files are published:

format: 'cjs',

And I am also using the library with a couple of nextjs projects (https://github.com/atanasster/grommet-nextjs)

I would guess something is amiss with your specific project configuration

Thanks for the response! I am no longer using next js but I'm sure your repo provides an adequate setup

Strangely, I have the same error but with razzlejs.
export * from './components/Avatar';
^^^^^^

SyntaxError: Unexpected token 'export'
at wrapSafe (internal/modules/cjs/loader.js:979:16)
at Module._compile (internal/modules/cjs/loader.js:1027:27)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)