Error when importing posts from WordPress blogs
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 125
- Forks
- 5
- PR merge metrics
- No merged PRs in 30d
Description
Using npx @11ty/import wordpress [blog url] --output=public - I can import all of the assets, but as soon as it starts to import posts, it does the following:
Importing post public\blurring-the-lines-extras-by-amy-kaybach.md (5.81kB) from https://www.charlisbookbox.com/blurring-the-lines-extras-by-amy-kaybach/
node:fs:2346
return binding.writeFileUtf8(
^
Error: ENOENT: no such file or directory, open 'C:\Users\demen\OneDrive\Desktop\CharityGambleDeveloper\bookbox\public\blurring-the-lines-extras-by-amy-kaybach.md'
at Object.writeFileSync (node:fs:2346:20)
at Importer.toFiles (file:///C:/Users/demen/OneDrive/Desktop/CharityGambleDeveloper/bookbox/node_modules/@11ty/import/src/Importer.js:462:8)
at file:///C:/Users/demen/OneDrive/Desktop/CharityGambleDeveloper/bookbox/node_modules/@11ty/import/cli.js:142:16
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
errno: -4058,
code: 'ENOENT',
syscall: 'open',
path: 'C:\Users\demen\OneDrive\Desktop\CharityGambleDeveloper\bookbox\public\blurring-the-lines-extras-by-amy-kaybach\.md'
}
It does not matter if the public folder is already created or not and this issue happens consistently whether I am attempting to import from a self-hosted WordPress installation or from a WordPress.com blog - the first post that tries to import consistently fails to work because the markdown file doesn't exist. Any ideas why this is happening? I've tried multiple times and it just never imports the posts, only the assets (images).
I'm not sure if this is a weird bug or possibly user-error, but it doesn't seem to matter how I do it or what WordPress source I use, it seems to always do this.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the command with the WordPress URL and inspect the failing write in node_modules/@11ty/import/src/Importer.js at line 462, with the call path from cli.js at line 142. Confirm why the generated post path cannot be opened, then verify that importing WordPress posts completes and writes the markdown files without ENOENT.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js, wordpress
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100