Uncaught Error: Cannot find module/ Require from a window that is opened by window.open


#1
Uncaught Error: Cannot find module/ Require from a window that is opened by window.open root - main.js - main-window - - index-main.html - - mainWindow.js - sub-window - - index-sub.html - - subWindow.js - components - - componentA.js
Process flow is below.

main.js
->win.loadUrl(index-main.html)
->load mainWindow.js
->window.open(index-sub.html)
->load subWindow.js

In the subWindow.js, I wrote a code require(…/components/componentA)
But the error below output
Uncaught Error: Cannot find module …/components/componentA

There is no error when mainWindow.js import componentA with the code below.
require(…/components/componentA)

I checked module.js with debugging tool. In a code below, Module._load = function(request, parent, isMain) parent value is root/node_modules/electron/dist/Electron.app/Contents/Resources/electron.asar/renderer/init.js

I don’t know why this happen. Usually, the value seems to be index-sub.html

So I don’t know what is the cause of this problem. If someone know the solution, could you help me?