New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Missing buildLocalizeArrayFn module #1014
Comments
Because you used |
I am using v2.0.0alpha23. What would be the correct way to dinamically import the package then? |
But my point actually is: Does this |
I currently couldn't find a way to import them properly. At the weekend I'll create a PR to export the languages from single files instead of folders so this depth thing won't be a problem. (Something like angular does here) So you would write something like: import(`date-fns/locales/${locale}.js`) This way there are no folders and depths to worry about. What do you think? |
There was a folder like that, see this |
I personally prefer this way too.
Maybe that's the folder that is missing now. |
I'll try adding that folder to my current test project and post the updates. Edit 1: There are actually many folders missing. I am going to use this reference here to make the errors disappear. Edit 2: After adding
Maybe it's referring to this. @TwoDCube can you confirm that? |
I think I managed to fix all the errors by adding the |
For my test project it worked perfectly. I tested it by using the Tomorrow I'll work on a PR for these files and check if everything is alright. |
I don't think it's a great idea to just recover those deleted directories. Probably they had a reason to remove those folders. Also I think it would still try to include the index.js -s from deeper directories too. I'll also make a PR to show my idea too. |
I totally agree with you. I made those changes just to check if we would have any other errors regarding dynamic imports and it appears we don't.
Yeah, it does.
I personally think that the idea of having all |
@ericreis please don't do that. I don't have time right now to dive deep into your problem, but this solution won't be accepted. First of all, there are unsupported locales that you don't want to import anyway. You can see the list here: https://github.com/date-fns/date-fns/blob/master/outdatedLocales.json. Secondly, the locales should stay modular. |
@kossnocorp perhaps then these locales should me moved to a separate location? Dynamic import is a powerful feature that right now is breaking due to outdated files in modules that won’t even be called. |
Any solution to this? I have the same issue. loadLocale = () => { |
I am getting compilation error due to unsupported locales present inside locale folder. Any solution? |
I did a work around for alpha 27 version by considering active locales I created supportingLanguages.js with
and then where ever i wanted to import
|
I'm facing the same issue when trying to dynamically import a locale file, are there any plans to remove the outdated locales? |
I've released a fix for this issue as |
I was trying to dynamically import locales from
date-fns
package and bumped into the following error:Module not found: Can't resolve '../../../_lib/buildLocalizeArrayFn/index.js' in '/Users/ericreis/dev/vtex/test/node_modules/date-fns/locale/ar-DZ/_lib/localize'
Here is the code I'm using to perform the dynamic import:
I searched everywhere for this
buildLocalizeArrayFn
folder, but I didn't find it anywhere. Is it a bug? If not, could anyone point to me what I am doing wrong?The text was updated successfully, but these errors were encountered: