-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Module parse failed: Unexpected character '�' (1:0) #2350
Comments
Just to add more information, this is the warning I receive on compile:
|
Hi, sharp requires the Node.js runtime and will not work in a browser. |
Oh, ok, it would've been great to use sharp client-side (because I'm using firebase/aws s3 for storage and I don't really have the need to do some server-side processing) and the other libraries for doing this in the browser are not as good as this one or as well-documented as this is... thanks anyway for your response. If there is a way to make this work in a browser (a workaround or something like that) please let me know. Thanks anyway, please close this issue if you consider it appropriate. |
Add to {
externals: {
sharp: 'commonjs sharp'
}
} |
Support svg image (using sharp), not support online svg now Add externals: { sharp: 'commonjs sharp'} in webpack.config.js lovell/sharp#2350 (comment) Zhihu username sometimes shows undefined, it is because profile is gziped Add gzip: true in fetchProfile Update ts-loader webpack typescript webpack-cli, with somebugs this undefined https://github.com/Microsoft/TypeScript/wiki/FAQ#why-does-this-get-orphaned-in-my-instance-methods Explictly call member function, e.g. const sendRequest = (options) => httpService.sendRequest(options) Always error on property override accessor microsoft/TypeScript#37894 My solution is set tooltip and description in the constructor Remove dep of uglifyjs-webpack-plugin add keyword of 知乎专栏, 知乎, Markdown
To fix this problem when using Vue, add this to your vue.config.js: |
Note adding it to webpack externals means that it won't be included in the bundle, which may not be what you want. If using node, you can include it with Install it: In webpack.config.js:
(Source) |
In my case I just had to add |
Hi,
I am having the following issue while trying to make sharp work on my local dev environment:
My code looks like this (using vue, btw, but i dont't think it can affect the output) :
Yes, but no information there about this issue.
Local dev machine so I guess it's ok
Not using root
Here's the output of that command:
Maybe the same as above
The text was updated successfully, but these errors were encountered: