You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[optional] remove serverExternalPackages and do step 5 - 6. It will now throw error
npm run build <-- error, if you did step 7, make sure to restore original next config
Is there an option to fully opt out of server-side code bundling?
npm run build error below.
./node_modules/@duckdb/node-bindings-linux-x64/duckdb.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)
It looks like the package you're importing is @duckdb/node-api and there's other deps it tries to import are failing to resolve. But that also happens with Turbopack. It depends on if you're on macOS/Linux/Windows.
My recommendation would be adding @duckdb/node-api:
import type { NextConfig } from "next";
const nextConfig: NextConfig = {
serverExternalPackages: ["@duckdb/node-api"],
};
export default nextConfig;
Link to the code that reproduces this issue
https://github.com/wmira/nextexternalbug
To Reproduce
serverExternalPackages only getting used in dev mode. When on build, it totally ignores it and webpack throws an error.
Is there an option to fully opt out of server-side code bundling?
npm run build error below.
./node_modules/@duckdb/node-bindings-linux-x64/duckdb.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)
Import trace for requested module:
./node_modules/@duckdb/node-bindings-linux-x64/duckdb.node
./node_modules/@duckdb/ ./node_modules/@duckdb/ sync ^./node-bindings-.-./duckdb.node$
./node_modules/@duckdb/node-bindings/duckdb.js
./node_modules/@duckdb/node-api/lib/index.js
./src/app/page.tsx
Current vs. Expected behavior
npm run dev and npm run build should work the same way.
Provide environment information
Which area(s) are affected? (Select all that apply)
Developer Experience, Webpack, Turbopack
Which stage(s) are affected? (Select all that apply)
next build (local)
Additional context
No response
The text was updated successfully, but these errors were encountered: