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

[2.0.0-beta.1] Webpack can't find driver module when path includes '//' #39

Closed
Flamenco opened this issue Aug 3, 2018 · 1 comment
Closed

Comments

@Flamenco
Copy link

Flamenco commented Aug 3, 2018

I am bundling this library into a single JS. The driver is not resolved at runtime.
Notice in the log the path ./drivers/mysql//adapters/pool.js

Here is the error.

Error: Couldn't load the "pool" Adapter library for mysql ({"host":"***","user":***","password":"***","database":"***"}): Error: Cannot find module './drivers/mysql//adapters/pool.js'
    at module.exports.get_adapter (/Users/steven/dev/projects/other/quickchords-server/src/main/resources/dist/main.js:7:15912)
    at new module.exports (/Users/steven/dev/projects/other/quickchords-server/src/main/resources/dist/main.js:7:13859)
    at Object.<anonymous> (/Users/steven/dev/projects/other/quickchords-server/src/main/resources/dist/main.js:1:4427)
    at __webpack_require__ (/Users/steven/dev/projects/other/quickchords-server/src/main/resources/dist/main.js:1:309)
    at Object.<anonymous> (/Users/steven/dev/projects/other/quickchords-server/src/main/resources/dist/main.js:164:370558)
    at __webpack_require__ (/Users/steven/dev/projects/other/quickchords-server/src/main/resources/dist/main.js:1:309)
    at /Users/steven/dev/projects/other/quickchords-server/src/main/resources/dist/main.js:1:1601
    at Object.<anonymous> (/Users/steven/dev/projects/other/quickchords-server/src/main/resources/dist/main.js:1:1648)
    at Module._compile (module.js:641:30)
    at Object.Module._extensions..js (module.js:652:10)

Here's the call.

 case 'pool':
                    const Pool = require(`${this.driver_info.path}/adapters/pool.js`)
                    return new Pool(settings);

suggestions

  • Remove the trailing slash from the driver descriptions.
  • ${removeTrailingSlash(this.driver_info.path)}/...

Also, the error dumped displays my connection username and password. That's a bit concerning.

@Flamenco Flamenco changed the title Webpack can't find driver module when path includes '//' [2.0.0-beta.1] Webpack can't find driver module when path includes '//' Aug 3, 2018
Flamenco added a commit to Flamenco/node-querybuilder that referenced this issue Aug 3, 2018
kylefarris pushed a commit that referenced this issue Aug 25, 2018
@kylefarris
Copy link
Owner

Issue resolved by #40

kylefarris pushed a commit that referenced this issue Feb 1, 2019
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

2 participants