question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"No valid exports main found for..." when trying to use `tsdx create`

See original GitHub issue

trying to create via ‘npx tsdx create projectname’

Current Behavior

see the error No valid exports main found for '/Users/anton/.npm/_npx/33468/lib/node_modules/tsdx/node_modules/@rollup/pluginutils'

Expected behavior

no error

Suggested solution(s)

???

Additional context

Your environment

Software Version(s)
TSDX not installed
TypeScript no global typescript
Browser doesn’t matter
npm/Yarn 6.13.4/1.22.4
Node 12.18.0/13.11.0/14.4.0 (tried with each of them)
Operating System macos catalina 10.15.4

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
agilgur5commented, Jun 17, 2020

Per your logging, this sounds like an issue in @rollup/pluginutils and not here. TSDX doesn’t even depend on it directly, it seems to be a transitive dep of the one of the Rollup deps, so not easy to pin to fix.

@rollup/pluginutils seems to have a main field in the package.json, but a recent change added conditional exports support which I guess has a bug.

I can’t remember if conditional exports are only in Node v13+ or if they are in v12 also. Node v10 should work if that’s the case then. EDIT: Node v12 does support conditional exports, so v12-14 giving the same errors on a conditional export makes sense. v10 doesn’t support it, so should be able to fall back to that until it is fixed upstream

0reactions
agilgur5commented, Jul 19, 2020

@rikoe thanks for investigating that! If that’s the issue then this is the same as https://github.com/formium/tsdx/issues/630, which points to upstream https://github.com/nodejs/node/issues/32107. But the two Rollup issues linked are in Rollup itself, which isn’t what’s giving the error, the plugin issue https://github.com/rollup/plugins/issues/473 is. Rollup and others seem to have created workarounds for Node v13.0-v13.7 so I’m not sure why pluginutils hasn’t used the same one.

But yes OP’s 12.18.0/13.11.0/14.4.0 would suggest that these are perhaps different issues we’re talking about. In any case, will close this out for now since you and OP have found solutions. Can open back up if it pops up again though would point upstream.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to fix “Error: No valid exports main found for ... - Dev Genius
Recently when I was developing for a React application that I hadn't pulled from the master branch in a while, I came across...
Read more >
How to fix “Error: No valid exports main found ... - Godwill Barasa
Take a look and make sure you are comfortable with the changes it is making. When you are satisfied, run the command again...
Read more >
How do I fix my "No valid exports main found" compile error?
I am using Windows 7 and the latest working Node version is 13.6. Therefore to make it run the only option is to...
Read more >
Fixing Create React App Error: No valid exports main found
If you're getting “No valid exports main found” in your Create React App, trying to install the latest version of NodeJS.
Read more >
You may not need a bundler for your NPM library
#Why would you NOT want a bundler for your library? My main argument is that the consumer of your library is the one...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found