Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EvalError: No "exports" main defined in ESM only modules #326

Open
visualjeff opened this issue Nov 20, 2024 · 0 comments
Open

EvalError: No "exports" main defined in ESM only modules #326

visualjeff opened this issue Nov 20, 2024 · 0 comments
Labels
status: waiting for maintainer These issues haven't been looked at yet by a maintainer

Comments

@visualjeff
Copy link

visualjeff commented Nov 20, 2024

Steps to reproduce

I'm trying use PigmentCSS with Nextjs along with my sample Component (that lives in an ESM only module) but I've run into this issue when I try to perform a Nextjs build:

unhandledRejection /Users/.../node_modules/@wyw-in-js/transform/lib/module.js:224
      throw new EvalError(`${e.message} in${this.callstack.join('\n| ')}\n`);
      ^
EvalError: No "exports" main defined in /Users/.../node_modules/@sample/sample-components/package.json in/Users/.../src/services/content/stackClient.ts

Any ideas on how I can get PigmentCSS to work with ESM only modules? I followed the instructions on how to configure Nextjs for PigmentCSS. The instructions were pretty straight forward.

Current behavior

No response

Expected behavior

No response

Context

No response

Your environment

Here is my environment info:

  System:
    OS: macOS 13.5
    CPU: (12) arm64 Apple M2 Max
    Memory: 106.67 MB / 32.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 18.19.1 - ~/.nvm/versions/node/v18.19.1/bin/node
    npm: 10.9.0 - ~/Documents/ADO/browse.costco.web/node_modules/.bin/npm
  npmPackages:
    @emotion/cache: 11.13.1 => 11.13.1 
    @emotion/react: 11.13.3 => 11.13.3 
    @emotion/styled: 11.13.0 => 11.13.0 
    @mui/material-nextjs: 6.1.6 => 6.1.6 
    @mui/material-pigment-css: ^6.1.7 => 6.1.7 
    @mui/system: 6.1.6 => 6.1.6 
    @mui/utils: 6.1.6 => 6.1.6 
    @pigment-css/nextjs-plugin: ^0.0.27 => 0.0.27 
    next: ^14.1.3 => 14.2.18 
    next-compose-plugins: 2.2.1 => 2.2.1 
    next-i18n-router: ^5.2.0 => 5.5.1 
    next-test-api-route-handler: ^4.0.5 => 4.0.14 
    react: ^18.2.0 => 18.3.1 
    react-dom: ^18 => 18.3.1 
    ts-node: ^10.9.2 => 10.9.2 
    typescript: ^5.4.2 => 5.6.3 
    webpack: 5.89.0 => 5.89.0 

Thank you!!!

Search keywords: ESM EvalError

@visualjeff visualjeff added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: waiting for maintainer These issues haven't been looked at yet by a maintainer
Projects
None yet
Development

No branches or pull requests

1 participant