Skip to content
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

BUG: u.startsWith is not a function #80

Closed
Tazi0 opened this issue Jun 30, 2024 · 9 comments
Closed

BUG: u.startsWith is not a function #80

Tazi0 opened this issue Jun 30, 2024 · 9 comments
Labels
bug Something isn't working

Comments

@Tazi0
Copy link

Tazi0 commented Jun 30, 2024

➜ npx nolyfill install 
Found 58 redundant packages:
 array-buffer-byte-length 1.0.1
 array-includes 3.1.8
 array.prototype.flat 1.3.2
 array.prototype.flatmap 1.3.2
 arraybuffer.prototype.slice 1.0.3
 assert 2.1.0
 available-typed-arrays 1.0.7
 deep-equal 2.2.3
 define-properties 1.2.1
 es-set-tostringtag 2.0.3
 function-bind 1.1.2
 function.prototype.name 1.1.6
 get-symbol-description 1.0.2
 globalthis 1.0.4
 gopd 1.0.1
 has-property-descriptors 1.0.2
 has-proto 1.0.3
 has-symbols 1.0.3
 hasown 2.0.2
 internal-slot 1.0.7
 is-arguments 1.1.1
 is-array-buffer 3.0.4
 is-core-module 2.14.0
 is-date-object 1.0.5
 is-generator-function 1.0.10
 is-regex 1.1.4
 is-shared-array-buffer 1.0.3
 is-string 1.0.7
 is-symbol 1.0.4
 is-typed-array 1.1.13
 is-weakref 1.0.2
 isarray 0.0.1
 object-keys 1.1.1
 object.assign 4.1.5
 object.entries 1.1.8
 object.fromentries 2.0.8
 object.getownpropertydescriptors 2.1.8
 object.values 1.2.0
 promise.allsettled 1.0.7
 regexp.prototype.flags 1.5.2
 safe-array-concat 1.1.2
 safe-regex-test 1.0.3
 set-function-length 1.2.2
 side-channel 1.0.6
 string.prototype.codepointat 0.2.1
 string.prototype.matchall 4.0.11
 string.prototype.padend 3.1.6
 string.prototype.padstart 3.1.6
 string.prototype.trim 1.2.9
 string.prototype.trimend 1.0.8
 string.prototype.trimstart 1.0.8
 typed-array-buffer 1.0.2
 typed-array-byte-length 1.0.1
 typed-array-byte-offset 1.0.2
 typed-array-length 1.0.6
 typedarray 0.0.6
 unbox-primitive 1.0.2
 which-typed-array 1.1.15

u.startsWith is not a function

I got this error? doesn't explain anything else :/

@SukkaW SukkaW added the bug Something isn't working label Jul 1, 2024
@nonzzz
Copy link
Contributor

nonzzz commented Jul 1, 2024

Can you share your local env?

@Tazi0
Copy link
Author

Tazi0 commented Jul 1, 2024

@nonzzz what would you like to see specifically? What local environment?

@nonzzz
Copy link
Contributor

nonzzz commented Jul 1, 2024

Like Nodejs version and which package manager and etc.

@Martinspire
Copy link

Martinspire commented Jul 10, 2024

Same issue here:
Node v20.13.1
Npm 10.8.1

Log:

Found 19 redundant packages:
 array-includes 3.1.8
 array.prototype.findlastindex 1.2.5
 array.prototype.flat 1.3.2
 array.prototype.flatmap 1.3.2
 deep-equal 1.1.2
 function-bind 1.1.2
 gopd 1.0.1
 has-proto 1.0.3
 has-symbols 1.0.3
 hasown 2.0.2
 is-core-module 2.13.1
 isarray 1.0.0
 object.fromentries 2.0.8
 object.groupby 1.0.3
 object.values 1.2.0
 set-function-length 1.2.2
 side-channel 1.0.6
 typedarray.prototype.slice 1.0.3
 which-typed-array 1.1.15

Trace: TypeError: u.startsWith is not a function
    at <local path>npm-cache\_npx\11dfa4defc9aa6e3\node_modules\nolyfill\dist\package-manager-B5oEznic.js:90:95
    at Array.reduce (<anonymous>)
    at transformOldOverrides (<local path>npm-cache\_npx\11dfa4defc9aa6e3\node_modules\nolyfill\dist\package-manager-B5oEznic.js:90:74)
    at Object.overridesPackageJson (<local path>npm-cache\_npx\11dfa4defc9aa6e3\node_modules\nolyfill\dist\package-manager-B5oEznic.js:90:668)
    at async t.<anonymous> (<local path>npm-cache\_npx\11dfa4defc9aa6e3\node_modules\nolyfill\dist\cli.js:28:156)
    at async t.parseAsync (<local path>npm-cache\_npx\11dfa4defc9aa6e3\node_modules\nolyfill\dist\cli.js:6:4119)
    at async <local path>npm-cache\_npx\11dfa4defc9aa6e3\node_modules\nolyfill\dist\cli.js:28:225
    at <local path>npm-cache\_npx\11dfa4defc9aa6e3\node_modules\nolyfill\dist\cli.js:28:292

Package.json


  "dependencies": {
    
... 3 corporate packages...

    "@angular/animations": "^18.0.3",
    "@angular/cdk": "^18.0.3",
    "@angular/common": "^18.0.3",
    "@angular/compiler": "^18.0.3",
    "@angular/core": "^18.0.3",
    "@angular/forms": "^18.0.3",
    "@angular/material": "^18.0.3",
    "@angular/platform-browser": "^18.0.3",
    "@angular/platform-browser-dynamic": "^18.0.3",
    "@angular/router": "^18.0.3",
    "@arcgis/core": "^4.29.10",
    "angular-eslint": "^18.0.1",
    "highcharts": "^11.4.0",
    "highcharts-angular": "^4.0.0",
    "marked": "^12.0.2",
    "ngx-markdown": "^18.0.0",
    "ngx-pipes": "^3.2.2",
    "ngx-quill": "^26.0.3",
    "quill": "^2.0.2",
    "rxjs": "~7.8.1",
    "tslib": "^2.6.2",
    "zone.js": "^0.14.4"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "^18.0.4",
    "@angular-eslint/builder": "^18.0.1",
    "@angular-eslint/eslint-plugin": "^18.0.1",
    "@angular-eslint/eslint-plugin-template": "^18.0.1",
    "@angular-eslint/schematics": "^18.0.1",
    "@angular-eslint/template-parser": "^18.0.1",
    "@angular/cli": "~18.0.4",
    "@angular/compiler-cli": "^18.0.3",
    "@badeball/cypress-cucumber-preprocessor": "^20.0.7",
    "@bahmutov/cypress-esbuild-preprocessor": "^2.2.0",
    "@commitlint/cli": "^19.2.1",
    "@commitlint/config-conventional": "^19.1.0",
    "@compodoc/compodoc": "^1.1.25",
    "@cypress/schematic": "^2.5.1",
    "@eslint/compat": "^1.1.0",
    "@eslint/eslintrc": "^3.1.0",
    "@eslint/js": "^9.5.0",
    "@ngneat/spectator": "^19.0.0",
    "@stylistic/eslint-plugin": "^2.2.2",
    "@testing-library/cypress": "^10.0.1",
    "@types/jasmine": "~5.1.1",
    "@typescript-eslint/eslint-plugin": "^7.4.0",
    "@typescript-eslint/parser": "^7.4.0",
    "autof": "^1.0.8",
    "concurrently": "^8.2.2",
    "cypress": "^13.12.0",
    "cypress-commands": "^3.0.0",
    "esbuild": "^0.21.5",
    "eslint": "^9.5.0",
    "eslint-config-prettier": "^9.0.0",
    "eslint-import-resolver-typescript": "^3.6.1",
    "eslint-plugin-import": "^2.29.0",
    "eslint-plugin-jasmine": "^4.2.0",
    "eslint-plugin-only-warn": "^1.1.0",
    "eslint-plugin-prettier": "^5.1.3",
    "globals": "^15.6.0",
    "husky": "^9.0.11",
    "jasmine-core": "^5.1.2",
    "karma": "~6.4.3",
    "karma-chrome-launcher": "~3.2.0",
    "karma-coverage": "~2.2.1",
    "karma-jasmine": "~5.1.0",
    "karma-jasmine-html-reporter": "~2.1.0",
    "ng-cache-testing-module": "^1.1.3",
    "ng-mocks": "^14.11.0",
    "nodemon": "^3.1.0",
    "prettier": "^3.2.5",
    "puppeteer": "^22.11.2",
    "typescript": "~5.4.3",
    "wait-on": "^7.2.0"
  },
  "overrides": {
    "karma-jasmine": {
      "jasmine-core": "^4.1.0 || ^5.0.0"
    },
  ... some corporate package override...
   
    "@typescript-eslint/eslint-plugin": {
      "eslint": "^8.57.0 || ^9.5.0"
    },
    "@typescript-eslint/parser": {
      "eslint": "^8.57.0 || ^9.5.0"
    },
    "@typescript-eslint/utils": {
      "eslint": "^8.57.0 || ^9.5.0"
    },
    "eslint-plugin-import": {
      "eslint": "^8.57.0 || ^9.5.0"
    }
  },

Compared to Tazio these are the same:
array-includes 3.1.8
array.prototype.flat 1.3.2
array.prototype.flatmap 1.3.2
function-bind 1.1.2
gopd 1.0.1
has-proto 1.0.3
has-symbols 1.0.3
hasown 2.0.2
object.fromentries 2.0.8
object.values 1.2.0
set-function-length 1.2.2
set-function-length 1.2.2
set-function-length 1.2.2

And these have different versions:
deep-equal (1.1.2 vs 2.2.3)
is-core-module (2.13.1 vs 2.14.0)
isarray (1.0.0 vs 0.0.1)

@nonzzz
Copy link
Contributor

nonzzz commented Jul 10, 2024

Ok, let me check what's happened.

@leefreemanxyz
Copy link

Does your package.json already have an overrides field defined? I just tried running it on a project and also got the u.startsWith error (running the latest Node LTS), but after cutting my overrides field out, the nolyfill install worked correctly.

@Martinspire
Copy link

Does your package.json already have an overrides field defined? I just tried running it on a project and also got the u.startsWith error (running the latest Node LTS), but after cutting my overrides field out, the nolyfill install worked correctly.

Ah yes, indeed, if I remove the overrides, it works. So it seems it has trouble merging them?

@jdalton
Copy link

jdalton commented Aug 20, 2024

Fixed in master branch.

@SukkaW
Copy link
Owner

SukkaW commented Aug 21, 2024

Fixed in master branch.

Yeah. It was fixed by #64 and #65 by @NamesMT. I am closing the issue now.

@SukkaW SukkaW closed this as completed Aug 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants