maxdavidson / rollup-plugin-sourcemaps

Rollup plugin for loading files with existing source maps
MIT License
65 stars 18 forks source link

An unhandled exception occurred: No valid exports main found #117

Closed smurfy closed 4 years ago

smurfy commented 4 years ago

Hi,

It seems the bug, which i think #115 tries to fix is still there. See: https://github.com/ng-packagr/ng-packagr/issues/1628

My local fix is removing the whole exports section from the package.json

  "exports": {
    "import": "./dist/index.js",
    "require": "./dist/index.cjs"
  },
Diceshake commented 4 years ago

Thanks for the temporary workaround!

maxdavidson commented 4 years ago

This only seems to happen on older versions of Node 13 (before 13.7) that support the exports field but not conditional exports. I can fix it by adding a default fallback, but I would also suggest for you to also use a more recent version of Node or get on the LTS train.

"exports": {
  "import": "./dist/index.js",
  "require": "./dist/index.cjs",
  "default": "./dist/index.cjs"
},