Hi I have to post this question again, since my last post didn’t get enough attantion and response!
I am developing an applicatoin with HubSpot UI Extension and I receive this error. Try all different possible solutions and unfortuntely none of them work. This question truely need an attention from HubSpot community!
Here is the error log:
fetchProperties serverless function failed due to this error:
2024-11-25T16:50:00.423Z ERROR - Error: Cannot find module './connectors/hubspot/factory/hubspot-connector.factory'
Require stack:
- /var/task/test.js
- /var/task/hubspotHandler.js
- /var/runtime/index.mjs
at Module._resolveFilename (node:internal/modules/cjs/loader:1140:15)
at Module._load (node:internal/modules/cjs/loader:981:27)
at Module.require (node:internal/modules/cjs/loader:1231:19)
at require (node:internal/modules/helpers:177:18)
at Object.<anonymous> (/var/task/test.js:13:37)
at Module._compile (node:internal/modules/cjs/loader:1364:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1422:10)
at Module.load (node:internal/modules/cjs/loader:1203:32)
at Module._load (node:internal/modules/cjs/loader:1019:12)
at Module.require (node:internal/modules/cjs/loader:1231:19) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/var/task/test.js',
'/var/task/hubspotHandler.js',
'/var/runtime/index.mjs'
]
}
Here is my file hierachy:
- fetchProperties.js
- connectors
- hubspot
- factory
- hubspot-connector.factory.js
As you see I am trying to make an import from “hubspot-connector-factory.js” file inside my serverless function “fetchProperties.js” and seems the Node.js runtime can’t understand this “relative path”. Has anyone confront with this problem before? what is the best soltuion/practice here?