Can not find files when using concurrently
See original GitHub issueI have the following pipe:
"scripts": {
"build": "concurrently -g npm:build:*",
"build:generate-db": "ts-node ./converter/main.ts",
"build:tailwind": "npx tailwindcss -i ./src/input.css -o ./static/css/build.css --minify",
"build:hugo": "hugo --minify",
},
build:generate-db
: Create.md
files for hugo application from a database.build:tailwind
: Generates tailwind file and puts it in correct folderbuild:hugo
: Creates hugo website with.md
files and tailwind file.
When I run the script hugo is not finding the .md
files. When I run the script a second time hugo finds the .md
files and create the website correct.
When I try this config, it’s working:
"scripts": {
"build": "concurrently -g npm:build:* & hugo --minify",
"build:generate-db": "npm run converter",
"build:tailwind": "npx tailwindcss -i ./src/input.css -o ./static/css/build.css --minify",
}
What I tried:
- First I thought the problem is the time the file write requires (so hugo is trying to find the files before they got written). This is not the case: Even when I sleep 10 seconds after
build:generate-db
hugo is not able to find the files as well. - When I run
build:generate-db
and thanbuild:hugo
it’s working. - The tailwind file is created correctly. (it’s also file write so why is this one working?)
The Converter writes like this:
writeFileSync(`${resultPath}/${data[titleKey]}.md`, JSON.stringify(resultDto, null, 2))
Here is the related stack overflow: https://stackoverflow.com/questions/71978982/hugo-can-not-find-created-files-by-node-when-using-concurrently
Issue Analytics
- State:
- Created a year ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Why can't npm find my commands when using concurrently
I want to call multiple commands with the dev command. I found here that using concurrently is the best way to make this...
Read more >'concurrently' is not recognized as an internal or external ...
To solve the error "'concurrently' is not recognized as an internal or external command, operable program or batch file", install the package globally...
Read more >concurrently - npm
Start using concurrently in your project by running `npm i ... The tool is written in Node.js, but you can use it to...
Read more >Frequently asked questions (FAQ) for Azure Files
Get answers to Azure Files frequently asked questions. You can mount Azure file shares concurrently on cloud or on-premises Windows, Linux, ...
Read more >session - Amazon Web Services - Go SDK
Sessions are safe to use concurrently as long as the Session is not being modified. Sessions should be cached when possible, because creating...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I think the
-g
option does not really run the scripts sequentially, it just pretends to do so. From the docs:Why are you using
concurrently
for this? Since it seems like your scripts need to be run one after the other and in exact order…I’ll close this issue as it seems it’s a no-op for concurrently, but feel free to continue discussing!