Open tinker-dev-monk opened 1 week ago
Let us check why it's not working.
Same here but in my case error looks like: ERROR TypeError: 0, _esToolkit.partial is not a function (it is undefined)
https://github.com/facebook/metro/issues/670
This may have affected you. They said they aim to support it without the unstable flag from 0.73, but it appears to still be unstable.
Thanks @nemorize! Yes, that's the issue. I've tested locally and alas Expo right now simply doesn't work with this unstable flag enabled. Seems like the entire ecosystem needs a fair bit more work until es-toolkit is going to be an option. I'll stick with implementing the functions I need as one off's.
@lypanov Or you can create a patch that modify es-toolkit's package.json
to have a main
or module
field.
Of course, I don't think the way is a good pratice...😭
No rush, I have no doubt this'll be fixed in time and I'll re-try my migration :) Thanks again for the help understanding this issue! Hopefully others than are not in the Expo ecosystem are able to make the switch.
In case it's any use to anyone looking into this, here is the documentation on enabling the required flag: https://reactnative.dev/blog/2023/06/21/package-exports-support
I'm encountering same issue with @lypanov when using Expo (51.0.31
), Metro (0.80.10
), and es-toolkit (1.17.0
).
Here's the workaround I used:
// babel.config.js
module.exports = function (api) {
api.cache(true);
return {
presets: ["babel-preset-expo"],
plugins: [
[
"module-resolver",
{
alias: {
"es-toolkit": "./node_modules/es-toolkit/dist/index.js", // Explicitly point to the CommonJS version
},
extensions: [".js", ".jsx", ".ts", ".tsx"], // Include relevant extensions
},
],
],
};
};
Please let me know if there is a better solution
hello. First of all, thank you for making such a good toolkit.
I want to use this toolkit in
react-native
but something is not working properly.Is there something I'm doing wrong?
Not just
debounce
, but others as well.Installed with the command above, and the
react-native
information is shown below.