snorreks / nx-cloud-functions-deployer

Plugin for Nx that adds support for deploying Cloud Functions for Firebase.
MIT License
6 stars 1 forks source link

cloud caching #8

Closed mostafa-tarek10 closed 5 months ago

mostafa-tarek10 commented 6 months ago

@snorreks thanks for the updates ^^

sadly now I have this issue but the deployment working as usual I think it's cloud caching again.

getOptionsFromCode SyntaxError: Expected property name or '}' in JSON at position 3 at JSON.parse () at wt (/home/mostafa/Documents/Firebase-NX/node_modules/.pnpm/nx-cloud-functions-deployer@2.5.3_tsx@3.14.0/node_modules/nx-cloud-functions-deployer/executors/deploy/index.js:12:5728) at Ue (/home/mostafa/Documents/Firebase-NX/node_modules/.pnpm/nx-cloud-functions-deployer@2.5.3_tsx@3.14.0/node_modules/nx-cloud-functions-deployer/executors/deploy/index.js:12:4845) at async Promise.all (index 2) at async qe (/home/mostafa/Documents/Firebase-NX/node_modules/.pnpm/nx-cloud-functions-deployer@2.5.3_tsx@3.14.0/node_modules/nx-cloud-functions-deployer/executors/deploy/index.js:12:7682) at async Promise.all (index 0) at async Mt (/home/mostafa/Documents/Firebase-NX/node_modules/.pnpm/nx-cloud-functions-deployer@2.5.3_tsx@3.14.0/node_modules/nx-cloud-functions-deployer/executors/deploy/index.js:30:3766) at async promiseToIterator (/home/mostafa/Documents/Firebase-NX/nodemodules/.pnpm/nx@17.2.7@swc-node+register@1.6.8_@swc+core@1.3.101/node_modules/nx/src/command-line/run/run.js:30:11) at async getLastValueFromAsyncIterableIterator (/home/mostafa/Documents/Firebase-NX/nodemodules/.pnpm/nx@17.2.7@swc-node+register@1.6.8_@swc+core@1.3.101/node_modules/nx/src/utils/async-iterator.js:13:19) at async iteratorToProcessStatusCode (/home/mostafa/Documents/Firebase-NX/nodemodules/.pnpm/nx@17.2.7@swc-node+register@1.6.8_@swc+core@1.3.101/node_modules/nx/src/command-line/run/run.js:41:29)

snorreks commented 6 months ago

It looks like it fails to read the options section of the file. See the limitation. When getOptionsFromCode fails, it will still deploy. but any options you have added will not be included when deploying.

Can you show me the code after export default ?

mostafa-tarek10 commented 6 months ago

@snorreks Seems like my problem is with not providing options at all for all the functions it was before export default onWritten(handleCustomerWrite); after I have changed to export default onWritten(handleCustomerWrite, {}); I got the same error

getOptionsFromCode SyntaxError: Expected property name or '}' in JSON at position 3 at JSON.parse () at wt (/home/mostafa/Documents/Firebase-NX/node_modules/.pnpm/nx-cloud-functions-deployer@2.5.3_tsx@3.14.0/node_modules/nx-cloud-functions-deployer/executors/deploy/index.js:12:5728) at Ue (/home/mostafa/Documents/Firebase-NX/node_modules/.pnpm/nx-cloud-functions-deployer@2.5.3_tsx@3.14.0/node_modules/nx-cloud-functions-deployer/executors/deploy/index.js:12:4845) at async Promise.all (index 2) at async qe (/home/mostafa/Documents/Firebase-NX/node_modules/.pnpm/nx-cloud-functions-deployer@2.5.3_tsx@3.14.0/node_modules/nx-cloud-functions-deployer/executors/deploy/index.js:12:7682) at async Promise.all (index 0) at async Mt (/home/mostafa/Documents/Firebase-NX/node_modules/.pnpm/nx-cloud-functions-deployer@2.5.3_tsx@3.14.0/node_modules/nx-cloud-functions-deployer/executors/deploy/index.js:30:3766) at async promiseToIterator (/home/mostafa/Documents/Firebase-NX/nodemodules/.pnpm/nx@17.2.7@swc-node+register@1.6.8_@swc+core@1.3.101/node_modules/nx/src/command-line/run/run.js:30:11) at async getLastValueFromAsyncIterableIterator (/home/mostafa/Documents/Firebase-NX/nodemodules/.pnpm/nx@17.2.7@swc-node+register@1.6.8_@swc+core@1.3.101/node_modules/nx/src/utils/async-iterator.js:13:19) at async iteratorToProcessStatusCode (/home/mostafa/Documents/Firebase-NX/nodemodules/.pnpm/nx@17.2.7@swc-node+register@1.6.8_@swc+core@1.3.101/node_modules/nx/src/command-line/run/run.js:41:29)

but at least I knew it looking for fields Expected property name or '}' I will try to give any options and try

mostafa-tarek10 commented 6 months ago

still the same error btw i see cloud caching is working fine now ^^

snorreks commented 5 months ago

Weird, can you show me the options section? There might be other limitations not mentioned in the readme

mostafa-tarek10 commented 5 months ago

Weird, can you show me the options section? There might be other limitations not mentioned in the readme

I got many functions and I didn't specify any options just the empty object {} for all till now.

mostafa-tarek10 commented 5 months ago

ok it's the callable functions causing this issue as I tried commenting them out and the error disappeared.

mostafa-tarek10 commented 5 months ago

fixed.