ok, it helped to exclude workers from the build bu...
# functions
i
ok, it helped to exclude workers from the build but I reverted code for my
functions/api/inquiry.js
endpoint to use Notion SDK
import { Client } from "@notionhq/client"
, so when I added the external package I got now another failed build with this statement
Copy code
22:30:18.149    Found Functions directory at /functions. Uploading.
22:30:18.882    ✨ Compiled Worker successfully
22:30:18.943    Validating asset output directory
22:30:19.550    Deploying your site to Cloudflare's global network...
22:30:22.711    Uploading... (72/79)
22:30:23.178    Uploading... (74/79)
22:30:23.454    Uploading... (76/79)
22:30:23.846    Uploading... (79/79)
22:30:23.846    ✨ Success! Uploaded 7 files (72 already uploaded) (1.62 sec)
22:30:23.846    
22:30:24.343    ✨ Upload complete!
22:30:25.957    Success: Assets published!
22:30:26.821    Error: Failed to publish your Function. Got error: Uncaught ReferenceError: global is not defined
  at functionsWorker-0.19086037171855352.js:477:49 in ../node_modules/node-fetch/browser.js
  at functionsWorker-0.19086037171855352.js:11:50 in __require
  at functionsWorker-0.19086037171855352.js:584:24 in ../node_modules/@notionhq/client/build/src/Client.js
  at functionsWorker-0.19086037171855352.js:11:50 in __require
  at functionsWorker-0.19086037171855352.js:932:20 in ../node_modules/@notionhq/client/build/src/index.js
  at functionsWorker-0.19086037171855352.js:11:50 in __require
  at functionsWorker-0.19086037171855352.js:1128:29 in api/inquiry.js
  at functionsWorker-0.19086037171855352.js:8:56 in __init
  at functionsWorker-0.19086037171855352.js:1136:5 in ../../../../tmp/functionsRoutes-0.015377362220493573.mjs
  at functionsWorker-0.19086037171855352.js:8:56 in __init
Are there some specifics I'm missing on how to import packages in functions or setup with next.js?