jaredpalmer / tsdx

Zero-config CLI for TypeScript package development
https://tsdx.io
MIT License
11.26k stars 508 forks source link

'No "exports" main resolved in' @babel/helper-compilation-targets/package.json when running `build` in WSL 2 #783

Closed danielkcz closed 4 years ago

danielkcz commented 4 years ago

Current Behavior

image

Expected behavior

It should finish the build successfully.

Suggested solution(s)

I am not sure if it doesn't boil down to some issue in Babel, would like to know your opinion before escalating it.

Additional context

The WSL 2 is the latest Windows Subsystem for Linux. So far it worked pretty well for all tasks, this is the first bummer. Running build directly on Windows works without an issue, so that's some potential culprit here. Unless it's a problem of Ubuntu (or any *nix system). I can't verify that.

I tried to reproduce the issue in some minimal environment, but no luck so far. The same is happening when building either mobx-react or mobx-react-lite packages. You can clone those and try npm run build, but I don't suppose anyone here has access to Ubuntu or Windows :)

Your environment

Software Version(s)
TSDX 0.13.2
TypeScript 3.7.5
Yarn 1.22.4
Node 14.4.0
Operating System Ubuntu 20.4 (in WSL2)
agilgur5 commented 4 years ago

Duplicate of #630

I am not sure if it doesn't boil down to some issue in Babel, would like to know your opinion before escalating it.

The error isn't coming from TSDX, so I would say that would be a better place to start. Per the issue this duplicates, it is upstream in Babel and actually upstream in Node.

You wrote that you're on Node 14.4 which is confusing as the issue should be limited to Node 13.1-13.8, but #747 and its upstream issues point to a potential regression in Node.

but I don't suppose anyone here has access to Ubuntu or Windows

Not readily, but the test suite runs in a matrix which includes both Ubuntu and Windows: https://github.com/formium/tsdx/blob/5e5c3f804e68609083be978a080ab905dc7ec19d/.github/workflows/nodejs.yml#L32

danielkcz commented 4 years ago

Thanks @agilgur5, that's really interesting. It's true that on WIndows machine itself I have Node 10.20.1, so that would be probably a reason why it works there.

At least on Ubuntu I can use NVM. Upon switching to 12.16.3 it works as well, but 12.17.0 is where it got broken apparently. So I am fine with a solution like that.