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
I have a language detection library tinyld which works in node (CJS) and browser (ESM) without trouble.
But I run into a strange issue when I try to use it in deno.
error: The module's source code could not be parsed: Unexpected character 'ำ'
The issue come from a big object where I store n-gram for different languages (as utf-8 strings)
I have thousands of other keys in there which do not cause any problem (japanese, chinese, arabic, ...)
//...อ: 9,ฮ: 9,ะ: 9,า: 9,ำ: 9,//...
But I don't now why, there is one specific thai character, ำ which cause that Unexpected character error
If I remove that line, it works fine.
So my question, is there a reason why this specific utf-8 character cause trouble?
P.S. I noticed that the same problem seem to appear in VSCode.
It kinda feel like this character is detected as a single quote, maybe more a typescript issue than deno.
The text was updated successfully, but these errors were encountered:
kefniark
changed the title
Source code utf-8 issue
Source code could not be parsed (Unexpected UTF-8 character)
Jan 22, 2022
This is not a bug with Deno's UTF-8 decoding, but an upstream bug with swc's parsing of JS/TS identifiers (variable names, etc., including non-string property names in object literals, as in this case). I filed swc-project/swc#3341.
Description
I have a language detection library tinyld which works in node (CJS) and browser (ESM) without trouble.
But I run into a strange issue when I try to use it in deno.
The issue come from a big object where I store n-gram for different languages (as utf-8 strings)
I have thousands of other keys in there which do not cause any problem (japanese, chinese, arabic, ...)
But I don't now why, there is one specific thai character,
ำ
which cause thatUnexpected character error
If I remove that line, it works fine.
So my question, is there a reason why this specific utf-8 character cause trouble?
P.S. I noticed that the same problem seem to appear in VSCode.
It kinda feel like this character is detected as a single quote, maybe more a typescript issue than deno.
The text was updated successfully, but these errors were encountered: