Closed pmcb99 closed 2 months ago
Hey. The Rust based tokenizers library uses https://github.com/napi-rs/napi-rs for Node bindings. From the error, it appears like Webpack is having issues with bundling it.
Could you try using fastembed in a regular Node application without Webpack? To see if it works and we can narrow the problem down to a Webpack compatibility issue.
Hey. The Rust based tokenizers library uses https://github.com/napi-rs/napi-rs for Node bindings. From the error, it appears like Webpack is having issues with bundling it.
Could you try using fastembed in a regular Node application without Webpack? To see if it works and we can narrow the problem down to a Webpack compatibility issue.
Yeah I'm able to get that running so must be a webpack issue
this next config and node-loader solved it for me
/** @type {import('next').NextConfig} */
const nextConfig = {
webpack: (config) => {
config.module.rules.push({
test: /\.node$/,
use: 'node-loader',
});
return config;
},
};
export default nextConfig;
Thanks for the insight @sorokinvj
I'm getting this error with NextJS 13, running Node 20.8:
module.exports = { externals: { '@anush008/tokenizers-darwin-universal': 'commonjs @anush008/tokenizers-darwin-universal' }, };
and
module.exports = { module: { rules: [ { test: /\.node$/, use: 'node-loader' } ] }, };