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

The "path" argument must be of type string #7

Closed
DeepSky8 opened this issue May 4, 2023 · 3 comments
Closed

The "path" argument must be of type string #7

DeepSky8 opened this issue May 4, 2023 · 3 comments

Comments

@DeepSky8
Copy link

DeepSky8 commented May 4, 2023

I think I'm failing to update the .env file correctly.

I copied the text in the provided .env.dist file into a new file I named 'process.env', and confirmed that it is a file of type .env. I've updated it with my information, as follows:

USER_NAME="DeepSky8"
LAYOUT_ID="0LXoN"
LAYOUT_FOLDER="moonlander_qwerty-js_source"
LAYOUT_SRC="./layout_src"

--

When I run
npm run get -- 0LXoN

I receive the following update and error:

Downloaded layout "0LXoN" to ./layout_src (from https://oryx.zsa.io/rails/active_storage/blobs/redirect/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBBNTAxUUE9PSIsImV4cCI6bnVsbCwicHVyIjoiYmxvYl9pZCJ9fQ==--bb15af0be4346b3ef05dc6d4b34036ec6d80b9ad/moonlander_qwerty-js_0LXoN_Jyz49.zip).

TypeError: The "path" argument must be of type string. Received undefined
at new NodeError (node:internal/errors:400:5)
at validateString (node:internal/validators:163:11)
at join (node:path:429:7)
at C:\Users\Joel\qmk_firmware\ergodox-macro-hax\src\oryx-downloader.ts:53:29

Could you offer some insight what I'm failing to do correctly?

Thanks!

@Phoscur
Copy link
Owner

Phoscur commented May 9, 2023

Hi! (sorry just noticed I have to follow my own repo or something - I did not get a notification)

LAYOUT_FOLDER="moonlander_qwerty-js_source"
LAYOUT_SRC="./layout_src"

This is the right configuration, so I am unsure why it breaks for you in L53 (this is where it joins those path strings to extract the folder).

I am using Node18 on Windows, what's your environment?

C:\Users\Phoscur\qmk_firmware\keyboards\moonlander\ergodox-macro-hax>npm run get -- 0LXoN

> oryx-macro-hax@2.0.0 get
> ts-node -r dotenv/config src/oryx-downloader.ts 0LXoN

Downloaded layout "0LXoN" to ./layout_src (from https://oryx.zsa.io/rails/active_storage/blobs/redirect/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBBNTAxUUE9PSIsImV4cCI6bnVsbCwicHVyIjoiYmxvYl9pZCJ9fQ==--bb15af0be4346b3ef05dc6d4b34036ec6d80b9ad/moonlander_qwerty-js_0LXoN_Jyz49.zip).
Unpacked folder: moonlander_qwerty-js_source

Edit: Latest pipeline is green, so the Unix build on Node16 also works as it should.
I can add a prompter with storage, like for the oryx-layer-inserter, which helps to set up!

Edit2: And you could try removing the quotes in the .env file, I think they are optional(?).

@Phoscur Phoscur mentioned this issue May 9, 2023
@Phoscur
Copy link
Owner

Phoscur commented May 9, 2023

Update: #8 will derive the folder name from the layout title & geometry!
You can already try it, it should be already better in advising you about the correct configuration!

@Phoscur
Copy link
Owner

Phoscur commented May 10, 2023

I copied the text in the provided .env.dist file into a new file I named 'process.env', and confirmed that it is a file of type .env.

@DeepSky8 found your mistake after reading your issue again - here is the solution:

The filename has to be .env not process.env! (this file is under gitignore)

Maybe I can get rid of the dotenv dependency and this difficulty¹ with yargs & node-persist... watch my progress in #8!

¹Windows Explorer might not let you do the renaming to "just a filename extension", I'd recommend using VSCode.

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