Open mindplay-dk opened 1 year ago
I didn't test it with TS >= 5.0 but I think it will not work because they changed compiler API a little.
New typegen
-based system is based on TS 5.1 and I had to fix almost 100 errors after pluging current Alpha source files in, but it were mostly type errors, so there is a small chance it will work.
The problem appears to be typelib/index.js which contains an export {} placeholder - but since the package is a CommonJS package, I don't think export is allowed?
It is not allowed in .js file at runtime in CommonJS environment but that file shouldn't be loaded.
import 'rttist/typelib';
is just a placeholder. TypeScript compiller should only load the .d.ts file (export {}
in d.ts file should be fine) but it should never load the .js file, it should be replaced by the metadata typelib file import, so it probably did not happen so that's why it ends with this error.
EDIT: You can try to manually modify the typelib/index.js file in node_modules/rttist folder. Then we'll se if it is rly an issue or not.
EDIT2:
BTW, I do not plan to do any changes in the current Alpha version because of new versions of TS, Webpack etc.
I'm working on the typegen
version and it goes pretty well so far; I think I'll be able to publish first prototype in a week or two.
Okay, cool, I think I'll just sit tight until then, let you get on with it. 😄
Looking forward to test the next version!
I attempted switching from TS 4 to 5, which also means switching from
ttypescript
tots-patch
.https://github.com/rttist/examples/compare/main...mindplay-dk:ts-patch-with-ts-5
It doesn't work, and it's not clear to me why it worked before this change.
Looking into
node_modules/rttist
, thepackage.json
has notype
, so node should default tocommonjs
.And all of the modules in the
dist
folder do appear to be commonJS modules withimport
/require
statements.The problem appears to be
typelib/index.js
which contains anexport {}
placeholder - but since the package is a CommonJS package, I don't thinkexport
is allowed?At least that's what the error message appears to suggest to me:
I don't even know if rttist itself is ready for TS 5, so I might be wasting my time here. 😅
I was just curious to see if that would work.