datocms / cli

Official CLI to interact with DatoCMS projects!
MIT License
7 stars 7 forks source link

wordpress import regex problem #23

Open cwrichardson opened 4 months ago

cwrichardson commented 4 months ago

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 commented 4 months ago

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 support@datocms.com 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 commented 3 months ago

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