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

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

Closed
scink opened this issue Jun 17, 2020 · 7 comments
Closed

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

scink opened this issue Jun 17, 2020 · 7 comments
Labels
problem: stale Issue has not been responded to in some time scope: upstream Issue in upstream dependency solution: workaround available There is a workaround available for this issue

Comments

@scink
Copy link

scink commented Jun 17, 2020

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
@agilgur5
Copy link
Collaborator

agilgur5 commented 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

@agilgur5 agilgur5 added the scope: upstream Issue in upstream dependency label Jun 17, 2020
@scink
Copy link
Author

scink commented Jun 18, 2020

@agilgur5, node v10 did work, thank you!

@agilgur5 agilgur5 added the solution: workaround available There is a workaround available for this issue label Jun 18, 2020
@rikoe
Copy link

rikoe commented Jul 16, 2020

Is there any update on this issue? None of the TSDX commands work if you are running any of the node versions after 10, which makes it really hard to use for my team - the latest stable Node is v12, so v10 is really quite old now, and most people have moved on. Is there a temporary workaround that can be applied to the TSDX package to protect users from these errors?

@jaredpalmer
Copy link
Owner

I use tsdx with node 12 on my Mac. Will try this out this am

@agilgur5
Copy link
Collaborator

agilgur5 commented Jul 16, 2020

@rikoe @jaredpalmer as has been written, this is not a TSDX issue, it is upstream in @rollup/pluginutils, and not even a direct dependency at that. There is no easy way to resolve that from TSDX's side.

I left this open as I still need to further investigate on their side to figure out an issue or PR to file against them. If this is still an issue and you want to resolve it, I would suggest going upstream to the source.

the latest stable Node is v12

That's not correct, Node v10 is LTS for another year. Maybe you're thinking of Node v8 which expired at the beginning of the year (also not that long ago).

@rikoe
Copy link

rikoe commented Jul 16, 2020

@agilgur5 sorry I don't mean Node 10 is out of LTS, just that v12 is the most recent LTS version on Node's website.

I think the related issue at rollup is rollup/rollup#3427.

They mention upgrading to Node v13.8 or higher, and this has indeed fixed the issue for me (although the original post said it didn't work for 12.18.0/13.11.0/14.4.0?). I was on 13.5.0 before. It seems therefore that the workaround above (downgrade to v10) is a bit drastic, it does work for other newer versions too.

It looks like rollup/rollup#3428 was merged and included in rollup 2.0.2 to address the issue?

This issue also seems to indicate that the problem is related to specific Node 13 point releases: rollup/plugins#473

@agilgur5
Copy link
Collaborator

agilgur5 commented Jul 18, 2020

@rikoe thanks for investigating that! If that's the issue then this is the same as #630, which points to upstream nodejs/node#32107. But the two Rollup issues linked are in Rollup itself, which isn't what's giving the error, the plugin issue rollup/plugins#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.

@agilgur5 agilgur5 changed the title "No valid exports main found for..." when try to create "No valid exports main found for..." when trying to use tsdx create Jul 18, 2020
@agilgur5 agilgur5 added the problem: stale Issue has not been responded to in some time label Oct 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
problem: stale Issue has not been responded to in some time scope: upstream Issue in upstream dependency solution: workaround available There is a workaround available for this issue
Projects
None yet
Development

No branches or pull requests

4 participants