Closed JustFly1984 closed 3 years ago
@JustFly1984 you've duplicated your own #630 -- as you wrote there the issue is a bug in Node itself, not in TSDX. Since then Node 13 reached EOL in June (c.f. #880). I wouldn't recommend using it as such and in either case it's caused some widespread issues with conditional exports in the community.
Regarding the TSDX v0.14.0 issue, that duplicates #888 and is upstream in rpts2 as the error suggests . #892 duplicated it as well and pointed out it only seems to happen with UMD for some reason (which #898, #896, and this seem to confirm).
Please search the issues and upstream before filing new ones.
@agilgur5 Thank you for fast response!
I can't redeploy docs since June. My lib is used by 2500 projects, and growing. I want to start recording video tutorials. Can you please estimate how long it will take for next release? Would love to update node to latest 14 version. If you can confirm that tsdx@0.14.0 supports node@14, I will test node 14. Still not sure that gatsby.js supports node 14 though.
Have a great day!
Can you please estimate how long it will take for next release?
ezolenko/rollup-plugin-typescript2#221 and #823 were the last two things I was looking to get in before releasing TSDX v0.14.1, but given ezolenko/rollup-plugin-typescript2#221 hasn't been released in over a week since merging and this UMD cache issue seems somewhat widespread, I was considering cutting a release for TSDX v0.14.1 early, possibly today.
But you should be able to use TSDX v0.13.3 fine. This bug is a bug in EOL Node 13, not in TSDX.
Still not sure that gatsby.js supports node 14 though
I'd be surprised if it doesn't. A large proportion of developers are already using Node 14. You can also downgrade to Node 12. Not sure if you're using some new Node feature or something.
If you can confirm that tsdx@0.14.0 supports node@14
Yes, the internal PR I linked to regarding Node 13, #880, upgraded TSDX's internal CI matrix to use Node 14. So can confirm it supports Node 14. I think a number of users have confirmed that as well.
@agilgur5 I have tested tsdx@0.13.3 and tsdx@0.14.0 with node 14.13.1 and it fails the build with same error
0.13.3
(babel plugin) Error: No "exports" main defined in /projects/react-google-maps-api/packages/react-google-maps-api-infobox/node_modules/@babel/helper-compilation-targets/package.json
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" main defined in /projects/react-google-maps-api/packages/react-google-maps-api-infobox/node_modules/@babel/helper-compilation-targets/package.json
at throwExportsNotFound (internal/modules/esm/resolve.js:290:9)
at packageExportsResolve (internal/modules/esm/resolve.js:513:3)
at resolveExports (internal/modules/cjs/loader.js:432:36)
at Function.Module._findPath (internal/modules/cjs/loader.js:472:31)
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:867:27)
at Function.Module._load (internal/modules/cjs/loader.js:725:27)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at Object.<anonymous> (/projects/react-google-maps-api/packages/react-google-maps-api-infobox/node_modules/@babel/preset-env/lib/debug.js:8:33)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
0.14.0
(typescript) Error: ENOENT: no such file or directory, rename /projects/react-google-maps-api/packages/react-google-maps-api-infobox/node_modules/.cache/rollup-plugin-typescript2/rpt2_2c34c68546ed43d39898c659568a2027b2495a19/code/cache_' -> '/projects/react-google-maps-api/packages/react-google-maps-api-infobox/node_modules/.cache/rollup-plugin-typescript2/rpt2_2c34c68546ed43d39898c659568a2027b2495a19/code/cache'
Error: ENOENT: no such file or directory, rename /projects/react-google-maps-api/packages/react-google-maps-api-infobox/node_modules/.cache/rollup-plugin-typescript2/rpt2_2c34c68546ed43d39898c659568a2027b2495a19/code/cache_' -> '/projects/react-google-maps-api/packages/react-google-maps-api-infobox/node_modules/.cache/rollup-plugin-typescript2/rpt2_2c34c68546ed43d39898c659568a2027b2495a19/code/cache'
at Object.renameSync (fs.js:770:3)
at RollingCache.roll (/projects/react-google-maps-api/packages/react-google-maps-api-infobox/node_modules/tsdx/node_modules/rollup-plugin-typescript2/dist/rollup-plugin-typescript2.cjs.js:24003:12)
at TsCache.done (/projects/react-google-maps-api/packages/react-google-maps-api-infobox/node_modules/tsdx/node_modules/rollup-plugin-typescript2/dist/rollup-plugin-typescript2.cjs.js:24845:24)
at Object._ongenerate (/projects/react-google-maps-api/packages/react-google-maps-api-infobox/node_modules/tsdx/node_modules/rollup-plugin-typescript2/dist/rollup-plugin-typescript2.cjs.js:29098:21)
at Object.generateBundle (/projects/react-google-maps-api/packages/react-google-maps-api-infobox/node_modules/tsdx/node_modules/rollup-plugin-typescript2/dist/rollup-plugin-typescript2.cjs.js:29076:18)
at /projects/react-google-maps-api/packages/react-google-maps-api-infobox/node_modules/rollup/dist/shared/node-entry.js:13117:25
at processTicksAndRejections (internal/process/task_queues.js:93:5)
error Command failed with exit code 1.
0.13.3
Well actually this is a slightly different error than the one in Node 13, it says "defined" instead of "resolved". In any case, please read the issue you duplicated -- your own #630 -- as this is either a bug in Babel or in Node or both. It's quite upstream of TSDX and hit by 1000s of people, probably the most widespread Node bug I've seen. It's not in or specific to TSDX, so this isn't the right place.
I looked into it for you and the upstream issue you linked to indeed suggests both are to blame and that @babel/helper-compilation-targets
@7.8.3 has this bug (per https://github.com/babel/babel/issues/11216#issuecomment-595323314). Your yarn.lock
pins that exact version. You can upgrade it or @babel/preset-env
in your lockfile to fix it.
0.14.0
Yes, I've already written and linked to where this error comes from and which issues it duplicates and which PR solves it. There's quite a lot of details in those issues. That's not unique to Node version.
If you pass this error, you might still hit the error above. Though TSDX v0.14.0 upgraded the internal @babel/preset-env
(#838 ), so it may indirectly change your yarn.lock
and indirectly upgrade @babel/helper-compilation-targets
to a newer version that doesn't have this bug.
The v0.14.0 cache issue has been fixed with #896 / https://github.com/ezolenko/rollup-plugin-typescript2/pull/243 and just released in v0.14.1.
You should be able to get v0.13.3 to work fine though, as I wrote above that seems to be directly due to your yarn.lock
pin, and not because of something in TSDX.
Current Behavior
Node 13.3.0 - issues on CI/CD
browserlist@^4.14.5
dependency of dependency, breaking netlify build of our docs and examples by requiring node engine version newer than 13.7.0tried both last versions of tsdx@0.13.3 v0.14.0, and experiencing different bugs in CI/CD.
v0.13.3
v0.14.0
Expected behavior
Should build packages with any node version.
Suggested solution(s)
Fix build pipeline
Additional context
You can fork https://github.com/JustFly1984/react-google-maps-api, run
nvm use
in each package directory separate, to test that each package builds correctly with combination tsdx@0.13.3 and node v13.3.0But if you run
nvm use
in the root of repository (v13.14.0), and try to run build scripts from root package.json to build docs and gatsby.js example, you'll get errors^^^Your environment
PS. My project is in condition where I can build and publish new versions of the lib, but can't deploy docs and examples.