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.

Module parse failed: Unexpected character '�' (1:0)

See original GitHub issue

While packaging code that includes sharp ^0.22.1, I encountered this error:

ERROR in [redacted]/node_modules/sharp/build/Release/sharp.node 1:0
Module parse failed: Unexpected character '�' (1:0)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
(Source code omitted for this binary file)
 @ [redacted]/node_modules/sharp/lib/input.js 5:14-52
 @ [redacted]/node_modules/sharp/lib/index.js
 @ [redacted]

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:21 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
jayaircommented, Oct 13, 2019

@compwright @Susan123456789 I’ve added a fix. I’ve created a beta version for you to test. Install it using:

$ npm install --save-dev serverless-bundle@beta

I’m excluding the sharp package by default. However, I’m not sure about this option that you are using:

    packagerOptions:
      scripts:
        - rm -rf node_modules/sharp && npm install --arch=x64 --platform=linux --target=8.10.0 sharp

Can you tell me what this does and if you need the plugin to have this option?

0reactions
jayaircommented, Jan 2, 2020

@compwright @grjzwaan Awesome! Thanks for the feedback guys. I’m going to package and push the beta soon.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Webpack 4 - Module parse failed: Unexpected character '@'
It's now throwing an error: Module parse failed: Unexpected character '@' You may need an appropriate loader to handle this file type.
Read more >
Module parse failed. Unexpected character '#'. #4603 - GitHub
I am using electron-vue. I would like to write some unit test. But encountered the following error. $npm run unit > dockeron@0.0.1 unit...
Read more >
Can't build with webpack - Material Design for Bootstrap
css 1:0 Module parse failed: Unexpected character '@' (1:0) You may need an appropriate loader to handle this file type, currently no loaders...
Read more >
Module parse failed: Unexpected character ' ' (1:0) You may ...
Coding example for the question Module parse failed: Unexpected character ' ' (1:0) You may need an appropriate loader to handle this file...
Read more >
Angular || How To Resolve Issue: “Module Parse Failed ...
This error basically means there is no appropriate webpack file loader installed in the project to handle the file being referenced. Out of...
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