knex / knex

A query builder for PostgreSQL, MySQL, CockroachDB, SQL Server, SQLite3 and Oracle, designed to be flexible, portable, and fun to use.
https://knexjs.org/
MIT License
19.28k stars 2.12k forks source link

Webpack is throwing an error during build #5877

Closed kibertoad closed 5 years ago

kibertoad commented 5 years ago
[webpack]  ERROR in ./node_modules/knex/src/dialects/mssql/index.js
[webpack]  Module not found: Error: Can't resolve 'mssql/lib/base' in 'C:\sources\documentation\node_modules\knex\src\dialects\mssql'
[webpack]   @ ./node_modules/knex/src/dialects/mssql/index.js 51:17-42
[webpack]   @ ./node_modules/knex/src/dialects sync ^\.\/.*\/index\.js$
[webpack]   @ ./node_modules/knex/src/knex.js
[webpack]   @ ./node_modules/knex/src/index.js
[webpack]   @ ./node_modules/knex/knex.js
[webpack]   @ ./components/Container.jsx
[webpack]   @ ./components/Documentation.js
[webpack]   @ ./components/client.jsx
kibertoad commented 5 years ago

@elhigu @lorefnon Any ideas?

lorefnon commented 5 years ago

This seems to have broken in https://github.com/tgriesser/knex/commit/c431ffc35a25885bc019a6f6d673971ef4fe4a4f#diff-b9cfc7f2cdf78a7f4b91a753d10865a2L134 due to this change in package.json:

-    "mssql/lib/base": false,
+    "mssql/src/base": false,

because dialects/mssql/index.js is still importing from mssql/lib/base but that is no longer ignored by webpack.

lorefnon commented 5 years ago

Verified locally that build works fine after reverting this change.