Open raonsol opened 1 year ago
any chance you solved this problem? I faced same one and I tried npm install node-libs-browser
and import it in notion-client.js but didn't work. it passed first error point but occured at below line
var nodejsMajorVersion = Number(process.versions.node.split(".")[0]);
@raonsol FYI, I tried to solve it with Pollypill and managed it but that wasn't a problem. even if you solve that problem you would face the CORS issue. this "process" and "CORS" occurred because we tried to call the notion's API from the client side so I installed notion-client on the node side and it worked fine
DOC says:
Description
Enviroment: Vite + Typescript + SWC
When I tried to create new
NotionAPI
object, vite throws an error.I think it is related with package
@szmarczak/http-timer
, which uses code that implicitly gets node version byprocess.versions.node
. Vite does not allow importing env variables withprocess
object. (https://vitejs.dev/guide/env-and-mode.html)