Skip to content
This repository has been archived by the owner on Nov 30, 2023. It is now read-only.

Error: No valid exports main found #77

Closed
babycourageous opened this issue May 25, 2020 · 5 comments
Closed

Error: No valid exports main found #77

babycourageous opened this issue May 25, 2020 · 5 comments

Comments

@babycourageous
Copy link

Hi there

When upgrading rollup-plugin-terser to 6.1.0 using rollup 2.10.9 (as part of a default svelte/template install) I get the following error:

[!] Error: No valid exports main found for '[...]/svelte-template/node_modules/rollup-plugin-terser'
Error: No valid exports main found for '/Users/rene/ActiveWork/Code/svelte-template/node_modules/rollup-plugin-terser'
    at resolveExportsTarget (internal/modules/cjs/loader.js:622:9)
    at applyExports (internal/modules/cjs/loader.js:499:14)
    at resolveExports (internal/modules/cjs/loader.js:548:12)
    at Function.Module._findPath (internal/modules/cjs/loader.js:654:22)
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:953:27)
    at Function.Module._load (internal/modules/cjs/loader.js:859:27)
    at Module.require (internal/modules/cjs/loader.js:1028:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object.<anonymous> (/Users/rene/ActiveWork/Code/svelte-template/rollup.config.js:11:1)
    at Module._compile (internal/modules/cjs/loader.js:1139:30)

Downgrading rollup-plugin-terser to ^5.1.2 for now works fine with rollup 2.x.

Thanks!

@TrySound
Copy link
Owner

Which node.js version do you use?

@TrySound
Copy link
Owner

See here. This usually happens in very old node 13 version without proper es modules support.
As it's considered unstable (all odd versions) usually only latest version is supported.
uuidjs/uuid#428

@babycourageous
Copy link
Author

babycourageous commented May 25, 2020

Thanks @TrySound - that was totally it (I was on 13.3.x).
I downgraded to latest stable version of node and all is well. Sorry bout that!

I'll go ahead and close this up.
Thanks again!

@Splode
Copy link

Splode commented May 29, 2020

I'm on node v13.3.0 and received this error as well when upgrading from 5.3.0 to 6.1.0, using rollup v2.11.2.

@babycourageous which version of node did you downgrade to?

@TrySound
Copy link
Owner

@Splode Just upgrade to the latest 13.x

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants