You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Yes, this behavior used to work in the previous version
The previous version in which this bug was not present was
No response
Description
I have a fresh Angular 19 application and I am trying to extend a browserslist configuration from a TS library that I changed to JS while debugging this issue. When I run the Angular build, it throws a type error.
Originally, I opened a ticket with the browserslist team so you can see browserslist/browserslist#891 for further context. I was getting errors with browserslist as they are using CommonJS requires in their code and my library and app were ESM. After removing browserslist-useragent-regexp, simplifying my library to JS, and still getting errors, they asked me to reach out to Angular as they were thinking Angular had an over complicated environment.
[error] TypeError: Cannot read properties of undefined (reading 'length')
at find (/../node_modules/browserslist/parse.js:12:25)
at matchBlock (/../node_modules/browserslist/parse.js:46:10)
at /../node_modules/browserslist/parse.js:73:17
at Array.map (<anonymous>)
at parse (/../node_modules/browserslist/parse.js:70:13)
at parseQueries (/../node_modules/browserslist/index.js:454:16)
at resolve (/../node_modules/browserslist/index.js:322:10)
at Function.select (/../node_modules/browserslist/index.js:1163:14)
at /../node_modules/browserslist/index.js:332:29
at Array.reduce (<anonymous>)
I’m unable to replicate the issue. However, running npx browserslist should return the resolved results based on the provided query.
I suggest to setup a runnable reproduction. You can read here why this is needed. A good way to make a minimal repro is to create a new app via ng new repro-app and adding the minimum possible code to show the problem. Then you can push this repository to github and link it here.
This might be related to your directory structure so its really important to get an accurate repro to diagnose this.
Command
build
Is this a regression?
The previous version in which this bug was not present was
No response
Description
I have a fresh Angular 19 application and I am trying to extend a browserslist configuration from a TS library that I changed to JS while debugging this issue. When I run the Angular build, it throws a type error.
Originally, I opened a ticket with the browserslist team so you can see browserslist/browserslist#891 for further context. I was getting errors with browserslist as they are using CommonJS requires in their code and my library and app were ESM. After removing browserslist-useragent-regexp, simplifying my library to JS, and still getting errors, they asked me to reach out to Angular as they were thinking Angular had an over complicated environment.
Minimal Reproduction
Create a shareable config following browserslist's instructions here: https://github.com/browserslist/browserslist?tab=readme-ov-file#shareable-configs
Here is my particular example with text changed as it's for a client I'm working with:
Snippet of application's package.json:
Here is the library's code for this config:
index.js
snippet of package.json
Exception or Error
Your Environment
Anything else relevant?
No response
The text was updated successfully, but these errors were encountered: