0

When try to load a compiled native NODE-Addon I got this error:

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)

actions.js

"use server";
// const reader = require("./reader.node");
import reader from "./reader.node";

export const fetchData = async (event) => {
  // const res = reader("./ETHUSDT-2023-08-02.tp");
  return;
};

File Structure: I got the two files in the same folder: actions.js & reader.node

I already tried to execute the reader.node file in a normal javascript file and then executed it with node in the terminal and that worked, so the native module file can't be the problem.

I also tried importing it with require() and import but both didn't work.

eliasbauer
  • 11
  • 2

0 Answers0