electron-remote icon indicating copy to clipboard operation
electron-remote copied to clipboard

Uncaught TypeError: request.charCodeAt is not a function

Open alexcroox opened this issue 7 years ago • 4 comments

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?

alexcroox avatar Jun 23 '17 17:06 alexcroox

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 avatar Jun 25 '17 19:06 alexcroox

@alexcroox have you solved this issue?

wateryoma avatar Jul 05 '17 21:07 wateryoma

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

alexcroox avatar Jul 05 '17 21:07 alexcroox

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

maxkoryukov avatar Nov 14 '17 20:11 maxkoryukov