shinshin86 / tauri-note-app

This is a note application created using tauri.
4 stars 0 forks source link

[lexical] SyntaxError: Invalid regular expression: invalid group specifier name #3

Open shinshin86 opened 1 year ago

shinshin86 commented 1 year ago

Error updating markdown with $convertFromMarkdownString (commit: https://github.com/shinshin86/tauri-note-app/pull/2/commits/5aa582a2b2dcab73980cf35b62d29433eb4e7f54).

When I run a macOS desktop app on tauri, WebKit is used, but lexical does not seem to recognize it as WebKit. We will continue to investigate this issue.

user-agent string

The user-agent string looks like this.

safari: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.1 Safari/605.1.15
tauri:  Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko)

Here is lexical's process for determining if it is a safari or not https://github.com/facebook/lexical/blob/main/packages/shared/src/environment.ts#L35-L36

lexical version

I am currently using v0.5.0 for this project. I have tried with the current latest version of lexical (v0.7.6) and the error is the same.

Related PR

https://github.com/shinshin86/tauri-note-app/pull/2

shinshin86 commented 1 year ago

It seemed to be possible to set the userAgent in tauri, so I solved this problem by setting the same userAgent as in Safari from there. I have updated tauri to the latest version. https://tauri.app/v1/api/config/#windowconfig