electron-remote
electron-remote copied to clipboard
Uncaught TypeError: request.charCodeAt is not a function
I'm not sure if this is a webpack issue, but I'm doing the following:
const fetchProjects = requireTaskPool(require.resolve('./Projects/fetchProjects'))
fetchProjects(this.existingProjects)
./Projects/fetchProjects.js
function fetchProjectsWorker (existingProjects) {
}
module.exports = fetchProjectsWorker
But I get Uncaught TypeError: request.charCodeAt is not a function
Debugging with console.log(require.resolve('./Projects/fetchProjects'))
returns 100
, so I think that might be the issue?
It's definitely an issue with webpack compatibility. But even when I manually put in an absolute path to the module as a string manually, I'm getting "Unexpected token import" (I have import statements at the top of the worker)
@alexcroox have you solved this issue?
No, turns out it's been confirmed several times by the author he won't support webpack, see denied PR helping to fix it: https://github.com/electron-userland/electron-remote/pull/20
Probably, one of the maintainers should fix the bug. But what to do right now?
I have a bug, and I know - it is because Webpack eats my import
and includes it into the bundle. But Electron-remote expects to load module by itself.
Probably, it is not a big deal for webpack-enlightened guys, but I am not one of them (at least for now), and I don't have 2 hours to find a proper solution.
So guys, if someone has a proper solution - PLEASE SHARE