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

ERR_INVALID_ARG_TYPE #293

Open
jvolker opened this issue Apr 27, 2020 · 2 comments
Open

ERR_INVALID_ARG_TYPE #293

jvolker opened this issue Apr 27, 2020 · 2 comments

Comments

@jvolker
Copy link

jvolker commented Apr 27, 2020

I'm trying to use this module in Electron with Vue. The module works well outside this setup. But during development using the webpack dev server, as soon as I require the module I receive this error:

Uncaught TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received type undefined
    at validateString (internal/validators.js:107)
    at Object.join (path.js:372)
    at eval (engine.js?72d2:16)
    at Object../node_modules/node-adodb/lib/engine.js (chunk-vendors.js:7791)
    at __webpack_require__ (app.js:785)
    at fn (app.js:151)
    at eval (index.js?d1a5:11)
    at Object../node_modules/node-adodb/index.js (chunk-vendors.js:7768)
    at __webpack_require__ (app.js:785)
    at fn (app.js:151)

Thanks.

@jvolker
Copy link
Author

jvolker commented Apr 28, 2020

This happens because the environment variables pointing to the windows dir / sysroot are undefined using Vue CLI:

const sysroot = process.env['systemroot'] || process.env['windir'];

Not sure if this happens in dev mode only.

More on the topic: https://cli.vuejs.org/guide/mode-and-env.html#environment-variables

@jvolker
Copy link
Author

jvolker commented Apr 29, 2020

I fixed this by hardcoding the path:

https://github.com/jvolker/node-adodb/blob/6a69b4fcd89e6b68e4018a0880ecabf994f332ac/lib/engine.js#L15

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