-
-
Notifications
You must be signed in to change notification settings - Fork 8
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
'javascript.builtins.Array.at' is unknown #16
Comments
|
I've got the same issue and I thing it's related to this line:
When executed in Node 19.2 imported from an ES module, because of the namespace import (* as), |
Thanks @mems, I patched this locally and it works: diff --git a/dist/esm/index.js b/dist/esm/index.js
index 5f01ddfca542c54ffedced4d4489aff4843d6067..2180bc326bd27c4c0d088aa06af185aadbd0b22b 100644
--- a/dist/esm/index.js
+++ b/dist/esm/index.js
@@ -1,6 +1,6 @@
import Browserslist from 'browserslist';
import { feature, features } from 'caniuse-lite';
-import * as compatData from '@mdn/browser-compat-data' assert { type: 'json' };
+import compatData from '@mdn/browser-compat-data' assert { type: 'json' };
import objectPath from 'object-path';
import { coerce, lt, gt, gte, lte } from 'semver';
import { UAParser } from 'ua-parser-js'; |
Thanks so much. Is there an ETA on when there will be a release available that patches this? |
I tried with the new version v3 but still have the same issue. I tried to understand why this is not an blocking issue when release new versions (since then we have have few more versions) With the following You will get something like:
It fail with pure (lot of "TypeError [Error]: The given feature: '${feature}' is unknown. It must be a valid Caniuse or MDN feature!"), but it pass with TS. package.jsonIt download {
"name": "browserslist-generator-test",
"version": "1.0.0",
"main": "index.js",
"scripts": {
"prepare": "curl -s https://raw.githubusercontent.com/wessberg/browserslist-generator/refs/heads/master/test/browserslist-generator.test.ts | sed 's|../src/index.js|browserslist-generator|g' > browserslist-generator.test.js",
"test": "node --test browserslist-generator.test.js",
"test-ts": "node --import tsx --test browserslist-generator.test.js"
},
"type": "module",
"dependencies": {
"browserslist-generator": "^3.0.0",
"tsx": "^4.19.2",
"useragent-generator": "^1.1.0"
}
} |
With the version 3.0.0, I use patch-package with the following patch This patch fix the issue https://github.com/wessberg/browserslist-generator/issues/16
diff --git a/node_modules/browserslist-generator/dist/index.js b/node_modules/browserslist-generator/dist/index.js
index a7640d4..76645e8 100644
--- a/node_modules/browserslist-generator/dist/index.js
+++ b/node_modules/browserslist-generator/dist/index.js
@@ -1,7 +1,7 @@
// src/browserslist-generator/browserslist-generator.ts
import Browserslist2 from "browserslist";
import { feature as caniuseFeature, features as caniuseFeatures } from "caniuse-lite";
-import * as compatData from "@mdn/browser-compat-data" with { type: "json" };
+import compatData from "@mdn/browser-compat-data" with { type: "json" };
import objectPath from "object-path";
import { gt as gt2, gte as gte3, lt as lt2, lte as lte2 } from "semver";
|
Related: #19 |
Occurs on Node 20.5.1 running 2.1.0.
I noticed the MDN import changed to a glob
*
import in the latest release. Not sure if that has something to do with it, but I was getting some warnings about experimental use of JSON import assertions also. If I revert back to previous version of browserslist-generator, all is fine. Still get the warning about experimental import assertions, though.The text was updated successfully, but these errors were encountered: