Private field '#head' must be declared in an enclosing class
justinr1234 opened this issue · comments
justinr1234 commented
Line 930 in 870a66d
In the web browser (nextjs), this is throwing an error Private field '#head' must be declared in an enclosing class
isaacs commented
But... it is declared in an enclosing class.
This works just fine, logs 2 0 1
in any modern browser:
<!DOCTYPE html>
<html>
<head>
<script type="module">
import { LRUCache } from 'https://unpkg.com/lru-cache@10.0.1/dist/mjs/index.js'
const cache = new LRUCache({ max: 3 })
cache.set('one', 1)
cache.set('two', 2)
cache.set('tre', 3)
cache.get('two')
const internals = LRUCache.unsafeExposeInternals(cache)
console.log(cache.get('two'), internals.head, internals.tail)
</script>
</head>
</html>
Idk what next is doing to LRUCache, but it's not correct.
justinr1234 commented
I was using an old version of the library via octokit