question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

fsevents get error "Module parse failed: Unexpected character '�' (1:0)"

See original GitHub issue

What is the problem

in ./node_modules/electron-reload/node_modules/fsevents/fsevents.node

Module parse failed: Unexpected character '�' (1:0)
You may need an appropriate loader to handle this file type.
(Source code omitted for this binary file)

 @ ./node_modules/electron-reload/node_modules/fsevents/fsevents.js 13:15-41

node: 10.12.0 electron: 6.0.7

How to reproduce

just require("electron-reload")(__dirname)

Additional information

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:7
  • Comments:14 (4 by maintainers)

github_iconTop GitHub Comments

79reactions
pverschacommented, Feb 20, 2020

@moarwick @Ratn I stumbled into the same problem today. A valid workaround for this problem is to add fsevents to your Webpack externals:

module.exports = {
  //...
  externals: {
    fsevents: "require('fsevents')"
  }
};

The issue is caused by this line const Native = require('./fsevents.node'); in fsevents.js. Since we’re using webpack, the require that’s being used here is the Webpack-equivalent of require() and not the one provided by node.

6reactions
pverschacommented, Feb 20, 2020

@yan-foto I don’t, I just stumbled into this thread and it was the only one that comes up on Google with this problem. It’s completely fsevents related, but I just wanted to post a solution here to help fellow Googlers of the problem 😉

Read more comments on GitHub >

github_iconTop Results From Across the Web

fsevents causes Module parse failed: Unexpected character ' '
Try check what encoding used in fsevents.node I was getting similar exception. Problem was in UTF-16 encoding of file.
Read more >
React Module Parse Failed: Unexpected Character '@'
A fix for now is to install the alpha version of the library. I've done a small setup just now to test this...
Read more >
Build Fails: webpack config.resolve.alias was incorrectly ...
I'm constantly getting a failed build because of 'webpack ... 10:55:40 PM: Module parse failed: Unexpected character ' ' (1:1) 10:55:40 PM: You...
Read more >
fsevents - npm
Native Access to MacOS FSEvents. Latest version: 2.3.2, last published: 2 years ago. Start using fsevents in your project by running `npm i ......
Read more >
webpack/webpack - Gitter
Can someone help me with this issue i can't seem to get the loader working. ... /ng-serve-logo-png10-error-module-parse-failed-unexpected-character-1.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found