question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TypeError: Cannot read property 'raw' of undefined

See original GitHub issue

Looks like @putout/plugin-regexp can’t handle named capturing groups.

const regexp = /(?<foo>a)/;

gives the following error:

TypeError: Cannot read property 'raw' of undefined
Occurred while linting /home/user/example.js:1
    at RegExpLiteral (/home/user/node_modules/@putout/plugin-regexp/lib/remove-useless-group/index.js:14:38)

ESLint: 7.30.0 putout: 18.4.0 eslint-plugin-putout: 8.1.0 @putout/plugin-regexp: 2.3.3

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
EvgenyOrekhovcommented, Jul 15, 2021

It works now, thank you!

0reactions
coderaisercommented, Jul 15, 2021

It happens only with ESM. I reproduced it here: EvgenyOrekhov/eslint-config-hardcore#319.

Fixed with 54e1145, landed in @putout/compare@7.6.1 🎉 . Is it works for you?

Read more comments on GitHub >

github_iconTop Results From Across the Web

ReactJS - TypeError: Cannot read property 'raw' of undefined
This happens because in the first render, this.state.photo is an array constructor(props) { super(props); this.state = { photo: [], photoId: ...
Read more >
Cannot Read Property of Undefined in JavaScript - Rollbar
TypeError: Cannot read property of undefined occurs when a property is read or a function is called on an undefined variable.
Read more >
Unhandled rejection TypeError: Cannot read property 'raw' of ...
For anybody else, I fixed it by wrapping trx.raw in a function instead of passing trx.raw directly to my callback.
Read more >
Topic: Cannot read property 'raw' of undefined - WordPress.com
I have just started trying to set up my site today using the Mayland theme, and I keep getting the error 'Cannot read...
Read more >
Cannot read property 'raw' of undefined-Reactjs - appsloveworld
Coding example for the question ReactJS: Cannot read property 'raw' of undefined-Reactjs.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found