Closed LadislavBohm closed 2 years ago
I would not recommend CRA in general as its almost never updated and it is fully maintained by a couple of volunteers. I actually switched the react test to use next js instead due to lack of updates and security issues with CRA packages.
Now unto the issue, I am guessing with CRA5 you need to specify --experimental-specifier-resolution=node
when running node.
There is this weird behavior with ES modules where
import { Foo } from "../directory"
doesn't work while
import { Foo } from "../directory/index.js"
(or maybe its .mjs)
So far TSC doesn't compile the code to directly import "index" file
Might be wrong here
I understand your concerns with CRA slow updates but that is actually one of the reasons I like using it. It makes sure all dependencies are updated in compatible way and it still an official recommended way to bootstrap react applications. Also I would say it's more like couple hundred of maintainers :-).
Is there any reason why this library is using CommonJS instead of ES modules? I thought the general shift in JS world was towards ES modules for quite some time.
The package delivers both Common JS and ES Modules. The module entry point is ./esm/index.js The CJS entry point is ./commonjs/index.js
I've got some tests here, https://github.com/arogozine/LinqToTypeScript/tree/master/tests/moduletest
You just need to specify the flag to run it, node --experimental-specifier-resolution=node index.js
I published an update that might help, https://www.npmjs.com/package/linq-to-typescript/v/10.0.0-beta1
The new version should not require --experimental-specifier-resolution=node
Let me know if it works
Sorry for late response. Version 10.0.0-beta1 is working for me now, thanks a lot. This is highly underappreciated project btw.
Hi, I had no issues using this great library in Vue, but in React (created with current npx create-react-app) I'm not able to make it work.
I tried to use it with both "from" approach and global initialization. As soon as I import anything from "linq-to-typescript" it does not compile. If there is any more info I can provide please let me know.