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

Compatibility with nextjs/shadcn projects #133

Closed
adsharma opened this issue Oct 26, 2024 · 2 comments
Closed

Compatibility with nextjs/shadcn projects #133

adsharma opened this issue Oct 26, 2024 · 2 comments

Comments

@adsharma
Copy link

adsharma commented Oct 26, 2024

This repo works just fine when nextjs/shadcn are not involved.

Repro:

 git clone https://github.com/sachidumaleesha/shadcn-dashboard test
 cd test
 npm install duckdb-async

Hit an API with some test code and you get:

⨯ ./node_modules/@mapbox/node-pre-gyp/lib/util/nw-pre-gyp/index.html
Module parse failed: Unexpected token (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
> <!doctype html>
| <html>
| <head>

Import trace for requested module:
./node_modules/@mapbox/node-pre-gyp/lib/util/nw-pre-gyp/index.html
./node_modules/@mapbox/node-pre-gyp/lib/ sync ^\.\/.*$
./node_modules/@mapbox/node-pre-gyp/lib/node-pre-gyp.js
./node_modules/duckdb/lib/duckdb-binding.js
./node_modules/duckdb/lib/duckdb.js
./node_modules/duckdb-async/dist/duckdb-async.js

Any hint on what's going on here and how to fix it?

@adsharma
Copy link
Author

This solution worked for me:

$ cat next.config.js
export default {
  webpack: (config) => {
    config.externals.push('duckdb');
    return config;
  }
};

But for projects using turbopack, there are still some webloader related failures.

@adsharma
Copy link
Author

Also tracked here:

mapbox/node-pre-gyp#661 and
motherduckdb/duckdb-async#35

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

1 participant