Code Monkey home page Code Monkey logo

Comments (15)

saiichihashimoto avatar saiichihashimoto commented on August 25, 2024 1

Just for context, I am using next.js which handles a significant part of the build process, including what's conflicting with this version. It is a specific way of configuring a project but I would definitely not consider it an outlier considering its wide adoption. My solution will be to stick with 0.3.0 since I would like to avoid patch-package.

from i18n-postal-address.

hubcards avatar hubcards commented on August 25, 2024 1

Same Problem, same Environment. Just wanted to emphasize that this is a standard Next.js/Vercel Scenario.

from i18n-postal-address.

joaocarmo avatar joaocarmo commented on August 25, 2024

@saiichihashimoto , can you share a bit of your code? How are you importing the module? I can't seem to reproduce this issue.

from i18n-postal-address.

saiichihashimoto avatar saiichihashimoto commented on August 25, 2024

image
image

from i18n-postal-address.

joaocarmo avatar joaocarmo commented on August 25, 2024

@saiichihashimoto thank you for sharing! Everything seems alright... What's the node version on your system?

from i18n-postal-address.

saiichihashimoto avatar saiichihashimoto commented on August 25, 2024

image

from i18n-postal-address.

joaocarmo avatar joaocarmo commented on August 25, 2024

@saiichihashimoto , can you try removing the lock file and re-installing the dependencies?

# Yarn
rm yarn.lock && yarn install

# npm
rm package-lock.json &&  npm install

If that doesn't work, try removing the engines key from your package.json file or changing it to:

"engines": {
    "node": ">=12",
    "npm": "6.14.6"
}

from i18n-postal-address.

saiichihashimoto avatar saiichihashimoto commented on August 25, 2024

I removed my package-lock and reinstalled, and the failure remained. For environment reasons I need to stay on node version 12.0, does 0.4.0 not work for 12 anymore?

from i18n-postal-address.

joaocarmo avatar joaocarmo commented on August 25, 2024

I can't think of a reason why that should be a problem. I recently changed the package.json to include an exports directive for better usage as an ESM module and that might be in conflict with the engines directive. Try removing that and see if it works. Edit the following file and remove the exports key entry:

node_modules/i18n-postal-address/package.json

If that works, you can make the changes permanent with patch-package.

from i18n-postal-address.

saiichihashimoto avatar saiichihashimoto commented on August 25, 2024

patch-package helps me avoid a problem, not solve it, correct? We should figure out a more long term solution that works here.

from i18n-postal-address.

joaocarmo avatar joaocarmo commented on August 25, 2024

This is more of a configuration issue which patch-package can resolve easily.

I'll close this issue for now.

from i18n-postal-address.

saiichihashimoto avatar saiichihashimoto commented on August 25, 2024

@joaocarmo I don't understand how a consumer's ability to rewrite the package means the issue is resolved. patch-package exists to fix broken node modules, indicating that the package is broken, not working-as-intended.

image

I would label this as wont-fix since that's more accurate.

from i18n-postal-address.

joaocarmo avatar joaocarmo commented on August 25, 2024

@saiichihashimoto , you are correct and I've labeled this as wontfix for now.

The reason behind my decision is that the recent changes makes the package more compatible with modern distribution channels such as CDNs.

It's unfortunate that it might break your application but, since it's due to a very particular configuration within your project, I believe patch-package is a good solution. It allows you to keep receiving the latest version without having to change anything.

Even though it might be described as a helper for broken packages, it also allows you to customize packages without having to fork them — which then would require you to maintain the fork to keep up with the updates.

from i18n-postal-address.

joaocarmo avatar joaocarmo commented on August 25, 2024

That's great to have documented, thanks for sharing your information!

Regarding your original issue (#11), since v.0.4.0 only adds custom formats, you can pass useTransforms: false in the options and it will not apply any transforms — that means no capitalisation.

from i18n-postal-address.

joaocarmo avatar joaocarmo commented on August 25, 2024

@hubcards which version are you using? TypeScript or plain JavaScript?

Edit: I built a proof of concept app using Next.js and cannot replicate the problem. Check it here and feel free to make a pull request with your configuration. To me, everything works as expected. I cannot fix this unless I can replicate the issue.

Also, @saiichihashimoto.

from i18n-postal-address.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.