i found that this is actually a node.js bug present in require.resolve, which is api we use to implement isolated modules. until they fix it, i have added a workarounds for it to resolve normally. this is fixed and it will be part of next jsreport release.
for the record, after fixing the bug i noticed that i was not able to finish the render of your template, i was getting browser error Failed to initialize WebGL
which is related to the usage of mapbox-gl, what worked for my machine (macos with Apple silicon) was to use chrome arg "--use-angle=gl"
, maybe it is not needed on your machine but i just wanted to share what worked for me in case you need it.
this is the final jsreport.config.json
that i've used
{
"httpPort": 5488,
"store": {
"provider": "fs"
},
"blobStorage": {
"provider": "fs"
},
"logger": {
"console": {
"transport": "console",
"level": "debug"
},
"file": {
"transport": "file",
"level": "info",
"filename": "logs/reporter.log"
},
"error": {
"transport": "file",
"level": "error",
"filename": "logs/error.log"
}
},
"trustUserCode": true,
"reportTimeout": 60000,
"workers": {
"numberOfWorkers": 1
},
"extensions": {
"authentication": {
"cookieSession": {},
"admin": {
"username": "admin",
"password": "password"
},
"enabled": false
},
"sample-template": {
"createSamples": true
},
"chrome-pdf": {
"launchOptions": {
"args": ["--no-sandbox", "--window-size=1800,1350", "--use-angle=gl"]
},
"strategy": "chrome-pool",
"allowLocalFilesAccess": true,
"numberOfWorkers": 3
},
"assets": {
"allowedFiles": "**/*.*",
"searchOnDiskIfNotFoundInStore": true,
"publicAccessEnabled": true,
"rootUrlForLinks": "file:///Volumes/DATA/workspace/jsreport-bug-with-specific-require-in-isolated-modules/data"
}
}
}