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

wordpress import regex problem #23

Open
cwrichardson opened this issue Mar 9, 2024 · 2 comments
Open

wordpress import regex problem #23

cwrichardson opened this issue Mar 9, 2024 · 2 comments

Comments

@cwrichardson
Copy link

I'm trying to import from Wordpress, and following the instructions here.

It fails with

SyntaxError: Invalid regular expression: /^([^\/:<>\*\?"\|]+(?:\/[^\/:<>\*\?"\|]+)?$/i: Unterminated group
    at new RegExp (<anonymous>)
    at reduceRouteComponents (/root/.local/share/datocms/node_modules/wpapi/lib/route-tree.js:83:3)
    at Array.reduce (<anonymous>)
    at reduceRouteTree (/root/.local/share/datocms/node_modules/wpapi/lib/route-tree.js:182:18)
    at /root/.local/share/datocms/node_modules/wpapi/lib/util/object-reduce.js:25:20
    at Array.reduce (<anonymous>)
    at module.exports (/root/.local/share/datocms/node_modules/wpapi/lib/util/object-reduce.js:24:3)
    at buildRouteTree (/root/.local/share/datocms/node_modules/wpapi/lib/route-tree.js:200:9)
    at WPAPI.bootstrap (/root/.local/share/datocms/node_modules/wpapi/wpapi.js:349:23)
    at new WPAPI (/root/.local/share/datocms/node_modules/wpapi/wpapi.js:88:4)
Endpoint detected, proceeding despite error...
Binding to https://www.chrisrichardson.info/wp-json/ and assuming default routes
✔ Destroy existing WordPress schema from DatoCMS project [19s]
❯ Import WordPress metadata
  ❯ Import WordPress categories
    ✔ Create DatoCMS model [4s]
    ✖ Retrieve categories from WordPress
    ◼ Import categories to DatoCMS
    ◼ Create category tree
  ❯ Import WordPress tags
    ✔ Create DatoCMS model [4s]
    ✖ Retrieve tags from WordPress
    ◼ Import tags to DatoCMS
  ❯ Import WordPress authors
    ✔ Create DatoCMS model [4s]
    ✔ Retrieve authors from WordPress [1s]
    ✖ Import authors to DatoCMS (1 of 2)
  ❯ Import WordPress assets
    ✖ Retrieve assets from WordPress
      › Unexpected token '<', "<br />
        <b>"... is not valid JSON
    ◼ Upload assets to DatoCMS
◼ Import WordPress pages and articles
    SyntaxError: Unexpected token '<', "<br />
    <b>"... is not valid JSON

This was initially on MacOS

% datocms help
VERSION
  @datocms/cli/2.0.0 darwin-x64 node-v18.17.1

But I thought it might be an issue with MacOS only supporting zsh now, so I spun up an Ubuntu docker container and tried it with Node 20, and it has the same problem.

@stefanoverna
Copy link
Member

I believe that in order to better understand what is happening, we should attempt the import ourselves. Could you please send all the details to [email protected] in order to start the import? In the email, include a link to this issue to help us connect the two problems.

Thank you!

@cwrichardson
Copy link
Author

Thanks, @stefanoverna. And sorry for the delayed response. I've just sent an email. Just putting this here to let you know that it happened, in case the email landed in your spam.

Thanks!
Chris

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