chakra-ui-prose icon indicating copy to clipboard operation
chakra-ui-prose copied to clipboard

ES6 import error "CommonJS module"

Open alexkreidler opened this issue 2 years ago • 0 comments

On Netlify I got this error:

4:54:08 PM: file:///opt/build/repo/dist/server/entries/renderer_default-page-server.mjs:6
4:54:08 PM: import { withProse } from "@nikolovlazar/chakra-ui-prose";
4:54:08 PM:          ^^^^^^^^^
4:54:08 PM: SyntaxError: Named export 'withProse' not found. The requested module '@nikolovlazar/chakra-ui-prose' is a CommonJS module, which may not support all module.exports as named exports.
4:54:08 PM: CommonJS modules can always be imported via the default export, for example using:
4:54:08 PM: import pkg from '@nikolovlazar/chakra-ui-prose';
4:54:08 PM: const { withProse } = pkg;
4:54:08 PM:     at ModuleJob._instantiate (node:internal/modules/esm/module_job:123:21)

I'm using pnpm, and this is the version of chakra-ui-prose:

'@nikolovlazar/chakra-ui-prose':
    specifier: ^1.2.1
    version: 1.2.1(@chakra-ui/[email protected])(@chakra-ui/[email protected])([email protected])

alexkreidler avatar May 20 '23 20:05 alexkreidler