-
Notifications
You must be signed in to change notification settings - Fork 336
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Broken Korean text in sandpack-react test error messages #1134
Comments
After investigating this issue, I've observed that the same error occurs in CodeSandbox. This suggests that the problem needs to be addressed in the codesandbox-client repository. I attempted to debug locally by logging to the console, but encountered difficulties running the project. As a result, I'm sharing the code sections that I suspect may be related to the issue: 1. Remote Module Fetchingasync function fetchRemoteModule(url: string): Promise<IRemoteModuleResult> {
try {
const r = await fetchWithRetries(url);
if (!r.ok) {
throw new Error(`Fetching ESModule return error status ${r.status}`);
}
const content = await r.text();
return {
url: r.url,
content,
};
} catch (err) {
console.error(err);
throw new ModuleNotFoundError(url, true);
}
} Potential solutionThe 2. File Evaluationexport function evaluateFromPath(
fs: any,
BFSRequire: Function,
path: string,
currentPath: string,
availablePlugins: Object,
availablePresets: Object
) {
const resolvedPath = patchedResolve().sync(path, {
filename: currentPath,
extensions: ['.cjs', '.js', '.json'],
});
const code = fs.readFileSync(resolvedPath).toString();
return evaluate(
fs,
BFSRequire,
code,
resolvedPath,
availablePlugins,
availablePresets
);
} Potential solutionEncoding issues might arise during file reading. We could use the It seems that identifying the correct locations for encoding handling is key to resolving this issue. Your insights on this would be greatly appreciated. @danilowoz 🙏 |
Bug report
Packages affected
Description of the problem
When a test case fails and the test description is in Korean, the error message displays broken characters, as below:
What were you doing when the problem occurred?
What steps can we take to reproduce the problem?
Visit the Sandpack Preset playground on the Sandpack documentation site.
Change the test description in the code to Korean. (e.g., 덧셈의 교환 법칙)
Modify the test case to intentionally fail. Here is an example modification.
Link to sandbox: -
Your Environment
The text was updated successfully, but these errors were encountered: