melloware / react-logviewer

React Lazy LogViewer
https://melloware.github.io/react-logviewer/
Mozilla Public License 2.0
45 stars 10 forks source link

NextJS 14: SyntaxError invalid range in character class #19

Closed dandelionn closed 7 months ago

dandelionn commented 7 months ago

Hello I am trying to use this package with Nextjs 14.0.4. Everything works fine in development mode but when I start a production build I get this error: firefox_bASmhim2ju

index-error firefox_xKcUgEmrwB

This is how I am using the component:

import { LazyLog, ScrollFollow } from '@melloware/react-logviewer';

const Component = () => {
    return (
      <ScrollFollow
        startFollowing={true}
        render={({ follow, onScroll }) => (
            <LazyLog
              text="text" 
              follow={follow} 
              onScroll={onScroll as any}
              enableSearch={true}
              enableSearchNavigation={true}
              caseInsensitive={true}
              selectableLines={true}
            />
        )}
    />
    )
};

Do you have any idea what is causing this issue in production?

melloware commented 7 months ago

Weird it happens in Production Mode. The error is this: https://stackoverflow.com/questions/16572123/javascript-regex-invalid-range-in-character-class

melloware commented 7 months ago

OK I am changing the way the regex is used.

melloware commented 7 months ago

OK i just published 5.0.3 to NPM can you try it ?

dandelionn commented 7 months ago

OK i just published 5.0.3 to NPM can you try it ?

yes

dandelionn commented 7 months ago

Thanks! it works :)

melloware commented 7 months ago

Nice! Thank for reporting.