Comments (7)
why not just push cjs and esm at same time?
from parse-domain.
Yes, since 6.0.0 the package is published as ECMAScript module only. Your options are:
- migrate your code to ECMAScript modules. It's the best long term solution but probably a lot of work. If you don't migrate, you will see this kind of error with every dependency update since more and more packages are migrating to ESM
- import it asynchronously via
await import("parse-domain")
(see https://nodejs.org/dist/latest-v16.x/docs/api/modules.html) - stay on version 5.0.0
from parse-domain.
Is this why I am getting the following?
Error [ERR_REQUIRE_ESM]
from parse-domain.
Is this why I am getting the following?
Error [ERR_REQUIRE_ESM]
yes
from parse-domain.
It appears this is intentional so this issue will probably be closed
BREAKING CHANGE: parse-domain will now be released as native ECMAScript module. There's no CommonJS build anymore. If you're still using CommonJS, you need to import it asynchronously using
await import("parse-domain")
. If you're still using Node 12, you may need to update it to the latest 12.x version.
from parse-domain.
We already did it for two years, but cross-publishing ESM and CJS is not as easy as it sounds. There are a couple of pitfalls I don't want to care of any longer. A lot of module maintainers are slowly switching to ESM, so you probably won't have a choice in the long term.
If you're still using CJS, you can use version 5.0.0
. It already has the parse-domain-update
command, so you can keep the internal list up-to-date.
from parse-domain.
@bluelovers Maybe that's an option for you: #142 (comment)
from parse-domain.
Related Issues (20)
- Problem with IP dependency? HOT 2
- string ends with dot is recognized as valid domain HOT 1
- result.domain not correct HOT 2
- Underscores in subdomains? HOT 5
- Domain is incorrectly splitting for gov.uk domain HOT 1
- No type property on parseResult HOT 2
- `.com.ru` isn't picked up as a top level domain in the ICANN form HOT 3
- False negative cases with new support for invalid IPV6 URLs HOT 2
- LABEL_INVALID_CHARACTER for a legitimate URL HOT 2
- Bad export directive since 42f54e8010c077c5375f0c96ab35a12bad35d3f4 (Jan 23) HOT 4
- No subdomain detected for withgoogle.com HOT 2
- Support for TypeScript on Node HOT 3
- Wrong top level domain detection based on the public suffix list HOT 1
- Cannot use library in Typescript CJS workspace HOT 3
- Error when update version (Webpack)
- How to use require instead of import? HOT 7
- Missing top level domains that got added past last publish date. HOT 2
- Leading dots lead to INVALID even with lax validation e.g .reflectoring.io
- Not parsing correct domain
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from parse-domain.