Skip to content
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

Unexpected character '�' (1:0) #98

Open
waseemhnyc opened this issue Jul 18, 2023 · 1 comment
Open

Unexpected character '�' (1:0) #98

waseemhnyc opened this issue Jul 18, 2023 · 1 comment

Comments

@waseemhnyc
Copy link

Hey there! I am trying to use this package in a Next JS 13 app.

Currently getting the following error:

./node_modules/canvas/build/Release/canvas.node
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)

I tried creating a webpack.config.js file and including a loader - but no luck.

Not sure exactly how to move forward from here.

@devsamuelv
Copy link

devsamuelv commented Aug 18, 2023

I came across the same issue how I fixed it was adding node-loader into the webpack config field inside next.config.js. Here's what my config looks like.

const nextConfig = {
	webpack: (config, options) => {
		config.module.rules.push({
			test: /\.node$/,
			loader: "node-loader",
		});

		return config;
	},
};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants