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
constpath=require('path');constModule=require('module')constcreateRequire=Module.createRequire;// あ.js is fail, but ああ.js is successconstresolved=path.resolve('あ.js');console.log(resolved);constreq=createRequire(resolved);// some package...constresult=req.resolve('_');console.log(result);
Run
$ node main.js
How often does it reproduce? Is there a required condition?
It is always reproduced when Node v22 is used under Windows in a Japanese environment.
Segmentation fault does not occur depending on the file name passed.
Not reproduced in Node v20.
What is the expected behavior? Why is that the expected behavior?
No segmentation fault shall occur.
This is expected to be fixed, since tools such as eslint cannot be used if files containing Japanese characters exist, since the same processing as the reproduced code is performed inside eslint.
I have confirmed that the following changes will be processed as intended in the SJIS environment.
However, we have not been able to determine the extent of the impact of using locale::global in the node runtime and ignoring the original locale....
Version
v22.13.0
Platform
Subsystem
No response
What steps will reproduce the bug?
Create required files
Create main.js
Run
How often does it reproduce? Is there a required condition?
It is always reproduced when Node v22 is used under Windows in a Japanese environment.
Segmentation fault does not occur depending on the file name passed.
Not reproduced in Node v20.
What is the expected behavior? Why is that the expected behavior?
No segmentation fault shall occur.
This is expected to be fixed, since tools such as eslint cannot be used if files containing Japanese characters exist, since the same processing as the reproduced code is performed inside eslint.
What do you see instead?
No output
Additional information
It's repro repository.
https://github.com/yamachu/node-require-japanese-repro
And
Node 22.2.0 Passed
Node 22.3.0 Failed
https://nodejs.org/download/nightly/v23.0.0-nightly20240521786cb42956/ is Passed
https://nodejs.org/download/nightly/v23.0.0-nightly202405224a54a80aa3/ is Failed
786cb42...4a54a80
The text was updated successfully, but these errors were encountered: